Skip to content

Commit 1764cc8

Browse files
committed
fixup! refactor(cli): rewrite rustup doc with clap-derive
1 parent 03494e1 commit 1764cc8

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

src/cli/rustup_mode.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1477,8 +1477,10 @@ fn override_remove(cfg: &Cfg, path: Option<&Path>, nonexistent: bool) -> Result<
14771477

14781478
macro_rules! docs_data {
14791479
(
1480-
$( $( #[$meta:meta] )*
1481-
($ident:ident, $help:expr, $path:expr $(,)?)),+ $(,)?
1480+
$(
1481+
$( #[$meta:meta] )*
1482+
($ident:ident, $help:expr, $path:expr $(,)?)
1483+
),+ $(,)?
14821484
) => {
14831485
#[derive(Debug, Args)]
14841486
struct DocPage {

tests/suite/cli-ui/rustup/rustup_doc_cmd_help_flag_stdout.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
bin.name = "rustup"
2-
args = ["doc","--help"]
2+
args = ["doc", "--help"]
33
stdout = """
44
...
55
Open the documentation for the current toolchain
66
7-
Usage: rustup[EXE] doc [OPTIONS] [topic]
7+
Usage: rustup[EXE] doc [OPTIONS] [TOPIC]
88
99
Arguments:
10-
[topic] Topic such as 'core', 'fn', 'usize', 'eprintln!', 'core::arch', 'alloc::format!',
10+
[TOPIC] Topic such as 'core', 'fn', 'usize', 'eprintln!', 'core::arch', 'alloc::format!',
1111
'std::fs', 'std::fs::read_dir', 'std::io::Bytes', 'std::iter::Sum',
1212
'std::io::error::Result' etc...
1313
1414
Options:
1515
--path Only print the path to the documentation
16-
--toolchain <toolchain> Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more
16+
--toolchain <TOOLCHAIN> Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more
1717
information see `rustup help toolchain`
1818
--alloc The Rust core allocation and collections library
1919
--book The Rust Programming Language book

tests/suite/cli-ui/rustup/rustup_help_cmd_stdout.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ The Rust toolchain installer
99
Usage: rustup[EXE] [OPTIONS] [+toolchain] [COMMAND]
1010
1111
Commands:
12-
doc Open the documentation for the current toolchain
1312
...
1413
self Modify the rustup installation
1514
set Alter rustup settings
@@ -24,6 +23,7 @@ Commands:
2423
override Modify toolchain overrides for directories
2524
run Run a command with an environment configured for a given toolchain
2625
which Display which binary will be run for a given command
26+
doc Open the documentation for the current toolchain
2727
help Print this message or the help of the given subcommand(s)
2828
2929
Arguments:

tests/suite/cli-ui/rustup/rustup_help_flag_stdout.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ The Rust toolchain installer
99
Usage: rustup[EXE] [OPTIONS] [+toolchain] [COMMAND]
1010
1111
Commands:
12-
doc Open the documentation for the current toolchain
1312
...
1413
self Modify the rustup installation
1514
set Alter rustup settings
@@ -24,6 +23,7 @@ Commands:
2423
override Modify toolchain overrides for directories
2524
run Run a command with an environment configured for a given toolchain
2625
which Display which binary will be run for a given command
26+
doc Open the documentation for the current toolchain
2727
help Print this message or the help of the given subcommand(s)
2828
2929
Arguments:

tests/suite/cli-ui/rustup/rustup_only_options_stdout.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ The Rust toolchain installer
99
Usage: rustup[EXE] [OPTIONS] [+toolchain] [COMMAND]
1010
1111
Commands:
12-
doc Open the documentation for the current toolchain
1312
...
1413
self Modify the rustup installation
1514
set Alter rustup settings
@@ -24,6 +23,7 @@ Commands:
2423
override Modify toolchain overrides for directories
2524
run Run a command with an environment configured for a given toolchain
2625
which Display which binary will be run for a given command
26+
doc Open the documentation for the current toolchain
2727
help Print this message or the help of the given subcommand(s)
2828
2929
Arguments:

0 commit comments

Comments
 (0)