clap-rs / clap

A full featured, fast Command Line Argument Parser for Rust
docs.rs/clap
Apache License 2.0
13.65k stars 1.02k forks source link

Fix documentation for Command::after_long_help() #5491

Closed pgerber closed 1 month ago

pgerber commented 1 month ago

Playground link showing that .afer_long_help() isn't shown with -h.

epage commented 1 month ago

As the documentation and the implementation diverge, an important thing to do is to determine which is "correct". I would generally recommend starting with an issue first, rather than a PR. However, I'm going to try to do that analysis here.

Current behavior

location short long notes
before help before_help before_long_help or before_help added in #2008, changed in #2174
command about about long_about or about changed in #1612
arg help help or long_help long_help or help
subcommand about about or long_about about or long_about changed in #2558
after help after_help after_long_help or after_help added in #2008, changed in #2174

Docs mismatch

The inconsistency in "command about"'s short and "subcommand about" is suspicious

Overall, this seems intentional enough with docs having been missed or changed as a result of a misunderstanding. I'm willing to go forward with this

epage commented 1 month ago

Thanks!