-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CAMEL-21896: camel-jbang - Allow configuration preset per directory #17593
base: main
Are you sure you want to change the base?
Conversation
I wonder if we need any new options at all. At first glance it seems more complicated and when would you use these options? I would assume that if there is a local file then its always used and take precedence over the default configuration. That's it. Are there other CLi tools that has these kind of options and are they also named similar ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks great besides the discussion about the usage of --mergeConfigurations
. My reply on the topic follows.
@@ -29,13 +29,16 @@ public class ConfigSet extends CamelCommand { | |||
@CommandLine.Parameters(description = "Configuration parameter (ex. key=value)", arity = "1") | |||
String configuration; | |||
|
|||
@CommandLine.Option(names = { "--local" }, description = "Retrieve configurations from current directory") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The wording should be "Store ... to" instead of "Retrieve ... from" here.
@@ -28,6 +28,9 @@ public class ConfigUnset extends CamelCommand { | |||
@CommandLine.Parameters(description = "Configuration key", arity = "1") | |||
String key; | |||
|
|||
@CommandLine.Option(names = { "--local" }, description = "Retrieve configurations from current directory") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Unset" instead of "Retrieve"
@@ -43,13 +43,16 @@ public class VersionSet extends CamelCommand { | |||
@CommandLine.Option(names = { "--reset" }, description = "Reset by removing any custom version settings") | |||
boolean reset; | |||
|
|||
@CommandLine.Option(names = { "--local" }, description = "Retrieve configurations from current directory") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Store ... to" over "Retrieve ... from"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or if we want the same wording for all options, we should consider a more generic wording. Examples:
"Apply configrations to current directoyr", or
"Use local configurations instead of global"?
If we start heavily using
For On the other hand, if we accept the new feature,
direnv uses the |
Ah sorry yeah sure the CLI tool for |
If the goal is to have per project "camel jbang" configuration file then I think it should be
|
Added the following options:
--mergeConfigurations
loads the configurations default one ~/.camel-jbang-user.properties and the one in the current directory (if exists) ./.camel-jbang-user.properties, the latter is prioritized. This config is a bit hacky, it is used to preload the configuration before the actual picocli execution, if the argument mergeConfigurations exists, the configurations are merged, and the argument removed before passing the args to Picocli.--local
Use the configuration in current directory (to be used withcamel config
commands)