Replies: 1 comment 1 reply
-
Would it work to instead hide default values and then include what you want in the |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to customize the
...
part of[default: ...]
in help messages.I have this code:
cargo run -- --help
outputs the following:(
USER
is my username.)However, what I want is the following:
The former (
[default: /home/USER/.cargo]
) is dynamic because each user has a different username. I prefer more fixed help messages.Also, the latter (
[default: $CARGO_HOME or $HOME/.cargo]
) shows that the value can be set via$CARGO_HOME
, but the former does not.It would be nice to be able to format default values in help messages, would you consider such a feature?
The relevant code can be found in clap_builder:
clap/clap_builder/src/output/help_template.rs
Line 784 in 475e254
Beta Was this translation helpful? Give feedback.
All reactions