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
$ cargo run -- --help
Running `target/debug/clapapp --help`test
USAGE:
clapapp [FLAGS]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
Example app overriding help, and different output:
I'm on mobile so I can't give a good link at the moment, but if you look at line 460 of src/app/parser.rs you'll see a call to build_help_and_version which never gets called when print_help is called.
Simply inserting that call will fix it, but also have the side effect that it's called twice on a normal run. So we either need to find a way to not call it twice, minimize the runtime impact if it is called twice, or something to the like.
Something that might help is use the Parser::is_set methods to check the internal AppSettings for things like NeedsLongHelp (or Version) instead of iterating all flags.
When overriding the
help
flag usinglong("help")
, the auto-generated help output is different from the default.Differences include:
bin_name
in the usage exampleversion
flag is displayedExample app, with expected default output:
Output:
Example app overriding help, and different output:
Output:
The text was updated successfully, but these errors were encountered: