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

TEST: update to clap 4.0.0-prerelease #316

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Conversation

Gankra
Copy link
Contributor

@Gankra Gankra commented Aug 27, 2022

this is a demo for clap-rs/clap#4132

@@ -3,17 +3,47 @@ source: tests/test-cli.rs
expression: format_outputs(&output)
---
stdout:
cargo-vet 0.3.0
cargo-vet-vet 0.3.0
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a regression, unclear whose fault it is (see clap-rs/clap#4132 (comment)).

Copy link

Choose a reason for hiding this comment

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

If you set name = cargo in addition to the bin_name, this should be resolved. See https://github.com/clap-rs/clap/blob/master/examples/cargo-example-derive.rs#L4

In clap 3, the user sets bin_name = cargo and we build that up as we recurse down the subcommands. When we then render the "name", we then did a search/replace on it which on windows without an explicit bin_name would end up with foo.exe-bar. So in clap 4, we build up the usage_name from the root command's bin_name + each subcommand's name and the display_name from all command's names.

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.

None yet

2 participants