Skip to content
New issue

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

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

Already on GitHub? # to your account

docs(builder): Avoid creating link to now-undocumented method #5371

Merged

Conversation

BenWiederhake
Copy link
Contributor

(This is an obvious bug or documentation fix, so that's why I skip the issue creation process.)

Currently, the method Command::dont_delimit_trailing_values contains a link to Command::trailing_var_arg, but that link is dead, as the method is not documented (anymore).

Therefore, the documentation for this method should link to Arg::trailing_var_arg instead, which is exactly what this PR does.

Note that there are a few more questionable uses of Command::trailing_var_arg, which I didn't dare to touch:

$ git grep -Firn 'nd::trailing_var'
clap_builder/src/builder/value_hint.rs:52:    /// [`.num_args(1..)`] and Command must use [`Command::trailing_var_arg(true)`]. The result is that the
clap_builder/src/builder/value_hint.rs:56:    /// [`Command::trailing_var_arg(true)`]: crate::Command::trailing_var_arg
clap_complete/examples/completion-derive.rs:56:    // Command::trailing_var_ar is required to use ValueHint::CommandWithArguments

The first two may or may not be outdated; the last one might be outdated, and is a typo in any case. But I'm not sure enough to fix either of them.

Bonus points if someone writes a linter that automatically checks whether documentation-internal links point to #[doc(hidden)] items. :-)

@BenWiederhake BenWiederhake force-pushed the dev-fix-link-command-trailing_var_arg branch from a457e53 to 0076cac Compare February 23, 2024 00:41
@BenWiederhake
Copy link
Contributor Author

Changes since last push:

  • Shortened commit subject (this 50-character limit is the shortest that I have ever seen)

@epage epage changed the title fix(builder): Avoid creating link to now-undocumented method docs(builder): Avoid creating link to now-undocumented method Feb 23, 2024
@epage
Copy link
Member

epage commented Feb 23, 2024

Thanks!

@epage epage merged commit d0028d7 into clap-rs:master Feb 23, 2024
22 checks passed
@BenWiederhake BenWiederhake deleted the dev-fix-link-command-trailing_var_arg branch February 23, 2024 03:13
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants