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
When writing a subcommand that requires further arguments that were not supplied, print a help message for the subcommand.
Example
argparse::ArgumentParser program("test");
argparse::ArgumentParser process_subcommand("subcom");
process_subcommand.add_description("One subcommand");
process_subcommand.show_help_on_failure(); // EXAMPLE function to be added
process_command.add_argument("action")
.help("Action to perform")
.choices("A", "B");
Then, when running the command, adding the --help would have the same effect as it wasn't there:
# With the help flag
./test subcom --help
Usage: test subcom [--help] [--version] [--action]
# Without the help flag
./test subcom
action: 1 argument(s) expected. 0 provided.
Usage: test subcom [--help] [--version] [--action]
The text was updated successfully, but these errors were encountered:
Use case
When writing a subcommand that requires further arguments that were not supplied, print a help message for the subcommand.
Example
Then, when running the command, adding the
--help
would have the same effect as it wasn't there:The text was updated successfully, but these errors were encountered: