-
Notifications
You must be signed in to change notification settings - Fork 892
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
Bump clap
to 3.0
#3064
Bump clap
to 3.0
#3064
Conversation
This is a big chunk of change - have you been running this locally too to verify nothing bad happens? |
I hadn't, but I will now, although I am not using |
clap v4 got released, might as well update to that version. |
@kinnison What kind of tests do we need to do? I am glad to help review and test this PR. |
Thanks for working on this! |
Still working on transition to UPD: Forgot I can convert PR to draft. |
I'd like to bump it up to v3 first and do more tests and release it. Because if we bump it up to v4, then we maybe get more broken changes. |
This doesn't bring joy :/
```
OPTIONS:
-h, --help Print help information
-V, --version Print version information
FLAGS:
-v, --verbose Enable verbose output
-q, --quiet Disable progress output
```
…On Thu, 8 Dec 2022 at 17:26, zohnannor ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/cli/rustup_mode.rs
<#3064 (comment)>:
> .version(common::version())
.about("The Rust toolchain installer")
.after_help(RUSTUP_HELP)
- .setting(AppSettings::VersionlessSubcommands)
- .setting(AppSettings::DeriveDisplayOrder)
- .setting(AppSettings::SubcommandRequiredElseHelp)
+ .global_setting(AppSettings::DeriveDisplayOrder)
+ .arg_required_else_help(true)
+ .next_help_heading("FLAGS")
@@ -1,16 +1,18 @@-$ rustup --help+$ ./target/debug/rustup --help-rustup 1.25.1 (bb60b1e 2022-07-12)+rustup unknown (66def54 2022-10-15) dirty 3 modifications
The Rust toolchain installer
USAGE:- rustup [FLAGS] [+toolchain] <SUBCOMMAND>+ rustup [OPTIONS] [+toolchain] [SUBCOMMAND]++OPTIONS:+ -h, --help Print help information+ -V, --version Print version information
FLAGS:
-v, --verbose Enable verbose output
-q, --quiet Disable progress output- -h, --help Prints help information- -V, --version Prints version information
ARGS:
<+toolchain> release channel (e.g. +stable) or custom toolchain to set override@@ -31,7 +33,7 @@ SUBCOMMANDS:
self Modify the rustup installation
set Alter rustup settings
completions Generate tab-completion scripts for your shell- help Prints this message or the help of the given subcommand(s)+ help Print this message or the help of the given subcommand(s)
DISCUSSION:
Rustup installs The Rust Programming Language from the official@@ -43,33 +45,35 @@ DISCUSSION:
If you are new to Rust consider running `rustup doc --book` to
learn Rust.
-- snip --
Old vs New
Old (`rustup 1.25 stable`) New (this `PR` 66def54
<66def54>
)
rustup 1.25.1 (bb60b1e 2022-07-12)
The Rust toolchain installer
USAGE:
rustup [FLAGS] [+toolchain] <SUBCOMMAND>
FLAGS:
-v, --verbose Enable verbose output
-q, --quiet Disable progress output
-h, --help Prints help information
-V, --version Prints version information
ARGS:
<+toolchain> release channel (e.g. +stable) or custom toolchain to set override
SUBCOMMANDS:
show Show the active and installed toolchains or profiles
update Update Rust toolchains and rustup
check Check for updates to Rust toolchains and rustup
default Set the default toolchain
toolchain Modify or query the installed toolchains
target Modify a toolchain's supported targets
component Modify a toolchain's installed components
override Modify directory toolchain overrides
run Run a command with an environment configured for a given toolchain
which Display which binary will be run for a given command
doc Open the documentation for the current toolchain
man View the man page for a given command
self Modify the rustup installation
set Alter rustup settings
completions Generate tab-completion scripts for your shell
help Prints this message or the help of the given subcommand(s)
DISCUSSION:
Rustup installs The Rust Programming Language from the official
release channels, enabling you to easily switch between stable,
beta, and nightly compilers and keep them updated. It makes
cross-compiling simpler with binary builds of the standard library
for common platforms.
rustup unknown (66def54 2022-10-15) dirty 3 modifications
The Rust toolchain installer
USAGE:
rustup [OPTIONS] [+toolchain] [SUBCOMMAND]
OPTIONS:
-h, --help Print help information
-V, --version Print version information
FLAGS:
-v, --verbose Enable verbose output
-q, --quiet Disable progress output
ARGS:
<+toolchain> release channel (e.g. +stable) or custom toolchain to set override
SUBCOMMANDS:
show Show the active and installed toolchains or profiles
update Update Rust toolchains and rustup
check Check for updates to Rust toolchains and rustup
default Set the default toolchain
toolchain Modify or query the installed toolchains
target Modify a toolchain's supported targets
component Modify a toolchain's installed components
override Modify directory toolchain overrides
run Run a command with an environment configured for a given toolchain
which Display which binary will be run for a given command
doc Open the documentation for the current toolchain
man View the man page for a given command
self Modify the rustup installation
set Alter rustup settings
completions Generate tab-completion scripts for your shell
help Print this message or the help of the given subcommand(s)
DISCUSSION:
Rustup installs The Rust Programming Language from the official
release channels, enabling you to easily switch between stable,
beta, and nightly compilers and keep them updated. It makes
cross-compiling simpler with binary builds of the standard library
for common platforms.
—
Reply to this email directly, view it on GitHub
<#3064 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADZ7XWGRHQLIF23NMTEGOLWMID4NANCNFSM57FWENSQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
If it helps, the clap migration guide recommends https://docs.rs/trycmd/latest/trycmd/ for testing the help output. To make it easier to see the differences, you could create a commit only adding trycmd, then upgrade clap, then bless the tests - the changes in the help output will show up in the diff, instead of having to reconstruct them from the code changes. |
I think that sort of test would be nice. That said, the main thing is that the new UI will still be usable. I think my main issue is that the cmd line help syntax line no longer matches the cmd line sections listed below it. |
@zohnannor Do you have time to add this test? If you are busy right now, I can help to add this test first. I think this test is not only useful for this time, but also we can use it in the future upgrade test. |
@hi-rustin yes, pretty busy right now, I'll try to come back to this Soon™. @jyn514 to clarify, you're suggesting to use |
That's up to the rustup maintainers, but I'd personally recommend integrating it with the test suite and leaving it there, that will make #3094 easier too. |
I am working on adding the trycmd tests. |
@zohnannor Friendly ping~ Thanks! 💚 💙 💜 💛 ❤️ |
Hey @hi-rustin thank you for caring!
No worries!
May I ask for the deadline date? I definitely will have time in the next couple (and by couple I mean ~4) of days to work on this again! I want to clarify some details of the changes to CLI API, the main complication for us is timezones :) So soon I'll compile a list of details and ask you to correct some of them if something is not as desired. |
I don't know when @hi-rustin was planning a release, but I can say that I have a thing that won't be ready before the weekend, that I really would love to include in the next release. So IMO the time frames are very compatible. |
My original plan was to prepare a release in the first week of next month. |
My original plan was to prepare a release in the first week of next month.
It's would be nice. Thank you very much.
Of course. Sounds good. I will wait for those changes. Thanks! |
Hi. I got heavily sick, my plan of finishing this PR in the next couple of days is busted. @hi-rustin you can take and finish it like you said. Thanks for help, very sad I couldn't finish it myself. I still have a #3094 though :) Sorry again for inconvenience. |
Ah, I hope you get well soon.
No worry. Thanks for your contribution! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
After this PR lands, I'll retest it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this might need a rebase or something, some of the diff is a bit odd:
-
t.skip("tests/cli-ui/rustup/rustup_man_cmd_help_flag_stdout.toml");
-
t.skip("tests/suite/cli-ui/rustup/rustup_man_cmd_help_flag_stdout.toml");
We just miss it last time. So I changed it in this PR. You can see https://github.com/rust-lang/rustup/blob/master/tests/suite/cli_ui.rs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious about the new blank line after commands, might make for a little unneeded vertical whitespace on terminals, but nothing to prevent merging.
I opened a question to ask the clap community. See clap-rs/clap#4745 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check again
I am going to merge this PR right now. @rbtcollins Thanks for your review! @zohnannor Thanks for your contribution! |
Bump
clap
to v3 which fixes incorrect executable name printing in subcommand's help texts on Windows (it comes asrustup.exe-subcommand
in v2). I don't think this issue was reported torustup
but clap-rs/clap#3693Add
clap_complete
as some ofclap
's functionality was moved into this crate.Fix related tests.
close #2920