Skip to content

Commit

Permalink
fixup! fixup! fixup! refactor(cli): (wip) rewrite `rustup (toolchain|…
Browse files Browse the repository at this point in the history
…update|(un)?install)` with `clap-derive`
  • Loading branch information
rami3l committed Jan 21, 2024
1 parent c00a97a commit c14ba56
Show file tree
Hide file tree
Showing 16 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion doc/user-guide/src/cross-compilation.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ To install a target for a toolchain that isn't the default toolchain use the
`--toolchain` argument of `rustup target add`, like so:

```console
$ rustup target add --toolchain <toolchain> <target>...
$ rustup target add --toolchain <TOOLCHAIN> <TARGET>...
```

To see a list of available targets, `rustup target list`. To remove a
Expand Down
2 changes: 1 addition & 1 deletion src/cli/help.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub(crate) static UPDATE_HELP: &str = r"Discussion:
pub(crate) static INSTALL_HELP: &str = r"Discussion:
Installs a specific rust toolchain.
The 'install' command is an alias for 'rustup update <toolchain>'.";
The 'install' command is an alias for 'rustup update <TOOLCHAIN>'.";

pub(crate) static DEFAULT_HELP: &str = r"Discussion:
Sets the default toolchain to the one specified. If the toolchain
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ Arguments:
<component>...
Options:
--toolchain <toolchain> Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more
--toolchain <TOOLCHAIN> Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more
information see `rustup help toolchain`
--target <target>
--target <TARGET>
-h, --help Print help
"""
stderr = ""
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ List installed and available components
Usage: rustup[EXE] component list [OPTIONS]
Options:
--toolchain <toolchain> Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more
--toolchain <TOOLCHAIN> Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more
information see `rustup help toolchain`
--installed List only installed components
-h, --help Print help
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ Arguments:
<component>...
Options:
--toolchain <toolchain> Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more
--toolchain <TOOLCHAIN> Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more
information see `rustup help toolchain`
--target <target>
--target <TARGET>
-h, --help Print help
"""
stderr = ""
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Arguments:
Options:
--path Only print the path to the documentation
--toolchain <toolchain> Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more
--toolchain <TOOLCHAIN> Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more
information see `rustup help toolchain`
--alloc The Rust core allocation and collections library
--book The Rust Programming Language book
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Arguments:
<command>
Options:
--toolchain <toolchain> Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more
--toolchain <TOOLCHAIN> Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more
information see `rustup help toolchain`
-h, --help Print help
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ stdout = """
...
Set the override toolchain for a directory
Usage: rustup[EXE] override set [OPTIONS] <toolchain>
Usage: rustup[EXE] override set [OPTIONS] <TOOLCHAIN>
Arguments:
<toolchain> Toolchain name, such as 'stable', 'nightly', '1.8.0', or a custom toolchain name. For
<TOOLCHAIN> Toolchain name, such as 'stable', 'nightly', '1.8.0', or a custom toolchain name. For
more information see `rustup help toolchain`
Options:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ stdout = """
...
Set the override toolchain for a directory
Usage: rustup[EXE] override set [OPTIONS] <toolchain>
Usage: rustup[EXE] override set [OPTIONS] <TOOLCHAIN>
Arguments:
<toolchain> Toolchain name, such as 'stable', 'nightly', '1.8.0', or a custom toolchain name. For
<TOOLCHAIN> Toolchain name, such as 'stable', 'nightly', '1.8.0', or a custom toolchain name. For
more information see `rustup help toolchain`
Options:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ stdout = """
...
Run a command with an environment configured for a given toolchain
Usage: rustup[EXE] run [OPTIONS] <toolchain> <command>...
Usage: rustup[EXE] run [OPTIONS] <TOOLCHAIN> <command>...
Arguments:
<toolchain> Toolchain name, such as 'stable', 'nightly', '1.8.0', or a custom toolchain name, or
<TOOLCHAIN> Toolchain name, such as 'stable', 'nightly', '1.8.0', or a custom toolchain name, or
an absolute path. For more information see `rustup help toolchain`
<command>...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ stdout = """
...
Add a target to a Rust toolchain
Usage: rustup[EXE] target add [OPTIONS] <target>...
Usage: rustup[EXE] target add [OPTIONS] <TARGET>...
Arguments:
<target>... List of targets to install; \"all\" installs all available targets
<TARGET>... List of targets to install; \"all\" installs all available targets
Options:
--toolchain <toolchain> Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more
--toolchain <TOOLCHAIN> Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more
information see `rustup help toolchain`
-h, --help Print help
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ List installed and available targets
Usage: rustup[EXE] target list [OPTIONS]
Options:
--toolchain <toolchain> Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more
--toolchain <TOOLCHAIN> Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more
information see `rustup help toolchain`
--installed List only installed targets
-h, --help Print help
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ stdout = """
...
Remove a target from a Rust toolchain
Usage: rustup[EXE] target remove [OPTIONS] <target>...
Usage: rustup[EXE] target remove [OPTIONS] <TARGET>...
Arguments:
<target>... List of targets to uninstall
<TARGET>... List of targets to uninstall
Options:
--toolchain <toolchain> Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more
--toolchain <TOOLCHAIN> Toolchain name, such as 'stable', 'nightly', or '1.8.0'. For more
information see `rustup help toolchain`
-h, --help Print help
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ stdout = """
...
Create a custom toolchain by symlinking to a directory
Usage: rustup[EXE] toolchain link <toolchain> <path>
Usage: rustup[EXE] toolchain link <TOOLCHAIN> <path>
Arguments:
<toolchain> Custom toolchain name
<TOOLCHAIN> Custom toolchain name
<path> Path to the directory
Options:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Arguments:
<command>
Options:
--toolchain <toolchain> Toolchain name, such as 'stable', 'nightly', '1.8.0', or a custom
--toolchain <TOOLCHAIN> Toolchain name, such as 'stable', 'nightly', '1.8.0', or a custom
toolchain name. For more information see `rustup help toolchain`
-h, --help Print help
"""
2 changes: 1 addition & 1 deletion tests/suite/cli_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ fn cannot_add_empty_named_custom_toolchain() {
let path = path.to_string_lossy();
config.expect_err(
&["rustup", "toolchain", "link", "", &path],
"invalid value '' for '<toolchain>': invalid toolchain name ''",
"invalid value '' for '<TOOLCHAIN>': invalid toolchain name ''",
);
});
}
Expand Down

0 comments on commit c14ba56

Please sign in to comment.