You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to enable the use of configuration files at the subcommand level rather than using the global CLI::App instance. It doesn't seem to work as expected regardless of what I try:
$ ./program sub --config config.ini
--option is required
Run with --help for more information.
I've tried two different config.ini files and I get the same behavior:
[sub]
option=42
option=42
If I instead do app.set_config() and then use config file (1) above, it works fine - but is there a way to define config files at the subcommand level instead?
The text was updated successfully, but these errors were encountered:
CLI is not currently setup to process config files for individual subcommands. It would be possible using a callback and execute sub->_process_config_file(..) with the config file from the option. This is what has been done the few times I have seen a need for it. But usually we let the top level handle the config files.
It would also be possible to create your subcommand as an option group, then add an alias so it will act as a subcommand but still read as part of the main from the perspective of a config file.
I'm trying to enable the use of configuration files at the subcommand level rather than using the global
CLI::App
instance. It doesn't seem to work as expected regardless of what I try:I've tried two different config.ini files and I get the same behavior:
If I instead do
app.set_config()
and then use config file (1) above, it works fine - but is there a way to define config files at the subcommand level instead?The text was updated successfully, but these errors were encountered: