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

Use Arg::value_name() as header for positionals in clap_mangen #3587

Merged
merged 3 commits into from
Apr 4, 2022
Merged

Use Arg::value_name() as header for positionals in clap_mangen #3587

merged 3 commits into from
Apr 4, 2022

Conversation

ducaale
Copy link
Contributor

@ducaale ducaale commented Mar 28, 2022

This was split out from #3580

@ducaale
Copy link
Contributor Author

ducaale commented Mar 28, 2022

There are two other things I would like to address for positional arguments but I am not sure if I should open a separate PR or not:

  • Don't show hidden flags in the SYNOPSIS sections.
  • Include triple dots if positional arg can be more than one item.

Edit: I would also need to fix any failing tests.

@epage
Copy link
Member

epage commented Mar 28, 2022

Don't show hidden flags in the SYNOPSIS sections.
Include triple dots if positional arg can be more than one item.

As these are all independent changes, I'd prefer separate PRs

I would also need to fix any failing tests.

Let me know if you have any problems with the snapshot testing (or any feedback on the process!)

clap_mangen/src/render.rs Outdated Show resolved Hide resolved
Copy link
Member

@epage epage left a comment

Choose a reason for hiding this comment

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

Thanks!

@ducaale
Copy link
Contributor Author

ducaale commented Mar 28, 2022

What would be the best way to preview .roff files? I am trying to compare the differences in snapshots before updating them with SNAPSHOTS=overwrite

$ man tests/snapshots/aliases.bash.roff

my-app(1)                                      General Commands Manual                                      my-app(1)

NAME
       my/-app /- testing bash completions

SYNOPSIS
       /fBmy/-app/fR      [/fB/-h/fR|/fB/-/-help/fR]     [/fB/-V/fR|/fB/-/-version/fR]     [/fB/-f/fR|/fB/-/-flag/fR]
       [/fB/-o/fR|/fB/-/-option/fR] [/fBpositional/fR]

DESCRIPTION
       testing bash completions

OPTIONS
       /fB/-h/fR, /fB/-/-help/fR
              Print help information

       /fB/-V/fR, /fB/-/-version/fR
              Print version information

       /fB/-f/fR, /fB/-/-flag/fR
              cmd flag

       /fB/-o/fR, /fB/-/-option/fR
              cmd option

       [/fBpositional/fR]

clap_mangen/src/render.rs Outdated Show resolved Hide resolved
Copy link
Member

@epage epage left a comment

Choose a reason for hiding this comment

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

Thanks!

@epage epage merged commit 858f184 into clap-rs:master Apr 4, 2022
@ducaale ducaale deleted the value-name-as-header-positional branch April 4, 2022 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants