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
Long story short: at this moment, tox-node uses the config subcommand to run a node with the configuration from a configuration file. The reason for this is because tox-node can be also run without a configuration file, with all required options passed as command line arguments. The usage of subcommand allows to avoid the situation when both configuration file and command line arguments are provides simultaneously.
The problem is, I believe that this is in no way a valid usage of subcommands. The purpose of subcommands is to provide actions, but config is not an action. So instead of config subcommand there should be the --config command line option.
At this moment, clap-rs provides no ergonomic way to specify an option that excludes all other options. This issue proposes adding a method for specifying such options.
The text was updated successfully, but these errors were encountered:
There is quite a bit of discussion about the handling of configuration files. This is one of the main goals v3 is trying to solve.
I'm not clear on if you're currently handling the configuration files manually? If so, I would recommend the follow instead of a unique:
note: This mainly works if the number of required by default arguments is relatively low
Create a --mode=MODE option, which only accepts two values config|cli, and defaults to cli
In your required arguments use Arg::required_if to only be required if --mode=cli
In your user-code, if --mode=config you can ignore CLI passed options (or allow CLI passed options to override the config options you've manually determined).
This is assuming I understood the problem correctly. While I'm not opposed to a unique option, I think there are better ways to handle the validation you're searching for. (Part of which will only become a thing once v3 is released though).
This feature request is inspired by this discussion.
Long story short: at this moment, tox-node uses the
config
subcommand to run a node with the configuration from a configuration file. The reason for this is because tox-node can be also run without a configuration file, with all required options passed as command line arguments. The usage of subcommand allows to avoid the situation when both configuration file and command line arguments are provides simultaneously.The problem is, I believe that this is in no way a valid usage of subcommands. The purpose of subcommands is to provide actions, but
config
is not an action. So instead ofconfig
subcommand there should be the--config
command line option.At this moment, clap-rs provides no ergonomic way to specify an option that excludes all other options. This issue proposes adding a method for specifying such options.
The text was updated successfully, but these errors were encountered: