Default configuration #187
Replies: 4 comments
-
One way to address this could be a configuration file (let's say, ~/.mcs.properties). Upon invocation, MCS would read that file and treat its contents as if the user specified it on the command line. If the user specifies something on the command line that would also be present in the file, the command line should have preference. |
Beta Was this translation helpful? Give feedback.
-
Today I learned about picocli's support for "argument files" or "@-files". Quoting from their documentation:
I feel this could be an easy approach to realise this "default configuration". If a file on the default path (hardcoded, let's say ~/.mcs/arguments) exists, it could be added to the user-supplied arguments. Handling duplicates can be tricky though. Imagine a user has
I'm not sure how much I like that last part - it feels a bit clunky. On the other hand, it seems like a relatively easy way to implement a "default configuration" - a lot easier than building it all from scratch. |
Beta Was this translation helpful? Give feedback.
-
Come to think of it a bit more, I think we should distinguish between two different concepts:
I think 2) is better scoped and much easier to implement than 1). I will try to give that a shot soon! |
Beta Was this translation helpful? Give feedback.
-
There are a few things in MCS where the user is likely to (almost) always make the same choice. Which format to output a dependency management snippet in (Maven POM, Gradle, ...). Whether or not to copy a single result to the clipboard immediately (#184).
I think it would be nice if the user could configure some defaults for that, with the option of course to override when they use MCS.
I'll post one idea how to solve this, but I'm curious if there could be other ways in which MCS users see this work.
Beta Was this translation helpful? Give feedback.
All reactions