Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update Arg::default_missing_value description #5531

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions clap_builder/src/builder/arg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1739,8 +1739,8 @@ impl Arg {

/// Value for the argument when the flag is present but no value is specified.
///
/// This configuration option is often used to give the user a shortcut and allow them to
/// efficiently specify an option argument without requiring an explicitly value. The `--color`
/// Configure a command-line argument that gives the user a shortcut and allows them to
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than giving an example of where this might be useful, this switches to more of an imperative tone that feels off putting. This would work better for a brief description but doesn't quite work for an example

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

command-line argument

"command-line" is implied from context of this library and makes this overly verbose.

"option" is more specific than "argument" as this isn't as useful for positional arguments.

/// efficiently select an option without requiring an explicit value. The `--color`
Comment on lines +1742 to +1743
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RE specify vs select

I feel like "select" would be "choosing an option from a drop down" while "specify" better connotes "write this out".

/// argument is a common example. By supplying a default, such as `default_missing_value("always")`,
/// the user can quickly just add `--color` to the command line to produce the desired color output.
///
Expand Down
Loading