-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
fix(parser): Resolve problems around allow_hyphen_values
#4187
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This has been a bit out of place being on the command. Now its clearer what the user intends to be the trailing var arg and it is more likely to be discovered.
Now that we have it on `Arg`, we don't need it on `Command`
…first pos This makes it match up with `Command::allow_hyphen_values` which was the guiding factor for what the behavior should be. This supersedes clap-rs#4039 Fixes clap-rs#3880 Fixes clap-rs#1538
epage
commented
Sep 7, 2022
Better to set on individual args
2 tasks
epage
added a commit
to epage/cargo
that referenced
this pull request
Oct 7, 2022
When working on clap v4, it appeared that `last` and `trailing_var_arg` are mutually exclusive, so I called that out in the debug asserts in clap-rs/clap#4187. Unfortunately, I didn't document my research on this as my focus was elsewhere. When updating cargo to use clap v4 in rust-lang#11159, I found `last` and `trailing_var_arg` were used together. I figured this was what I was trying to catch with above and I went off of my intuitive sense of these commands and assumed `trailing_var_arg` was intended, not knowing about the `testname` positional that is mostly just a forward to `libtest`, there for documentation purposes, except for a small optimization. This restores us to behavior from 531ce13 which is what I originally wrote the tests against.
epage
added a commit
to epage/cargo
that referenced
this pull request
Oct 7, 2022
When working on clap v4, it appeared that `last` and `trailing_var_arg` are mutually exclusive, so I called that out in the debug asserts in clap-rs/clap#4187. Unfortunately, I didn't document my research on this as my focus was elsewhere. When updating cargo to use clap v4 in rust-lang#11159, I found `last` and `trailing_var_arg` were used together. I figured this was what I was trying to catch with above and I went off of my intuitive sense of these commands and assumed `trailing_var_arg` was intended, not knowing about the `testname` positional that is mostly just a forward to `libtest`, there for documentation purposes, except for a small optimization. So it looks like we just need the `last` call and not the `trailing_var_arg` call. This restores us to behavior from 531ce13 which is what I originally wrote the tests against.
wmmc88
referenced
this pull request
in rust-lang/cargo
Nov 2, 2023
This mirrors some of the categories from `cargo help` (the man pages). There are fewer categories to avoid extra vertical space. Instead, they are left int the `Options` category but put first.
eatradish
added a commit
to AOSC-Tracking/choose
that referenced
this pull request
Mar 30, 2024
structopt has been replaced by clap, whose dependency libc does not build on newer architectures (e.g., loongarch64). My previous attempts to port choose to clap v4 resulted in an incompatible change in allow_hyphen_values's behavior - I have reported this issue to the upstream: - clap-rs/clap#5434 - clap-rs/clap#4187 To simplify things, I wrote my own argument parser for clap.. This change passes `cargo test` .
eatradish
added a commit
to AOSC-Tracking/choose
that referenced
this pull request
Mar 30, 2024
structopt has been replaced by clap, whose dependency libc does not build on newer architectures (e.g., loongarch64). My previous attempts to port choose to clap v4 resulted in an incompatible change in allow_hyphen_values's behavior - I have reported this issue to the upstream: - clap-rs/clap#5434 - clap-rs/clap#4187 To simplify things, I wrote my own argument parser for clap.. This change passes `cargo test` .
eatradish
added a commit
to AOSC-Tracking/choose
that referenced
this pull request
Mar 30, 2024
structopt has been replaced by clap, whose dependency libc does not build on newer architectures (e.g., loongarch64). My previous attempts to port choose to clap v4 resulted in an incompatible change in allow_hyphen_values's behavior - I have reported this issue to the upstream: - clap-rs/clap#5434 - clap-rs/clap#4187 To simplify things, I wrote my own argument parser for clap.. This change passes `cargo test` .
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The main focus is on making
Arg::allow_hyphen_values
behave likeCommand::allow_hyphen_values
and removing the latter. Some debug asserts and documentation got improved along the way.This supersedes #4039
Fixes #3880
Fixes #1538
Fixes #3450