From d868d0576eca49f0f57185c7815723cd54bbabc1 Mon Sep 17 00:00:00 2001 From: rami3l Date: Fri, 10 May 2024 20:32:34 +0800 Subject: [PATCH] fix(rustup-init): fix typo in `rustup-init[.sh]` args --- rustup-init.sh | 4 ++-- src/cli/setup_mode.rs | 12 ++++++------ .../rustup-init/rustup-init_help_flag_stdout.toml | 4 ++-- .../rustup-init/rustup-init_sh_help_flag_stdout.toml | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/rustup-init.sh b/rustup-init.sh index d65834ac7f..de0c317850 100755 --- a/rustup-init.sh +++ b/rustup-init.sh @@ -50,9 +50,9 @@ Options: Choose a default toolchain to install. Use 'none' to not install any toolchains at all --profile [default: default] [possible values: minimal, default, complete] - -c, --components ... + -c, --component ... Component name to also install - -t, --targets ... + -t, --target ... Target name to also install --no-update-default-toolchain Don't update any existing default toolchain after install diff --git a/src/cli/setup_mode.rs b/src/cli/setup_mode.rs index fea154f3f9..37a47d09e1 100644 --- a/src/cli/setup_mode.rs +++ b/src/cli/setup_mode.rs @@ -51,11 +51,11 @@ struct RustupInit { /// Component name to also install #[arg(short, long, value_delimiter = ',', num_args = 1..)] - components: Vec, + component: Vec, /// Target name to also install #[arg(short, long, value_delimiter = ',', num_args = 1..)] - targets: Vec, + target: Vec, /// Don't update any existing default toolchain after install #[arg(long)] @@ -85,8 +85,8 @@ pub fn main() -> Result { default_host, default_toolchain, profile, - components, - targets, + component, + target, no_update_default_toolchain, no_modify_path, self_replace, @@ -119,8 +119,8 @@ pub fn main() -> Result { profile, no_modify_path, no_update_toolchain: no_update_default_toolchain, - components: &components.iter().map(|s| &**s).collect::>(), - targets: &targets.iter().map(|s| &**s).collect::>(), + components: &component.iter().map(|s| &**s).collect::>(), + targets: &target.iter().map(|s| &**s).collect::>(), }; self_update::install(no_prompt, verbose, quiet, opts) diff --git a/tests/suite/cli-ui/rustup-init/rustup-init_help_flag_stdout.toml b/tests/suite/cli-ui/rustup-init/rustup-init_help_flag_stdout.toml index 2331f46f81..f080fc9e5c 100644 --- a/tests/suite/cli-ui/rustup-init/rustup-init_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup-init/rustup-init_help_flag_stdout.toml @@ -21,9 +21,9 @@ Options: Choose a default toolchain to install. Use 'none' to not install any toolchains at all --profile [default: default] [possible values: minimal, default, complete] - -c, --components ... + -c, --component ... Component name to also install - -t, --targets ... + -t, --target ... Target name to also install --no-update-default-toolchain Don't update any existing default toolchain after install diff --git a/tests/suite/cli-ui/rustup-init/rustup-init_sh_help_flag_stdout.toml b/tests/suite/cli-ui/rustup-init/rustup-init_sh_help_flag_stdout.toml index c6c74e0438..8646af73af 100644 --- a/tests/suite/cli-ui/rustup-init/rustup-init_sh_help_flag_stdout.toml +++ b/tests/suite/cli-ui/rustup-init/rustup-init_sh_help_flag_stdout.toml @@ -21,9 +21,9 @@ Options: Choose a default toolchain to install. Use 'none' to not install any toolchains at all --profile [default: default] [possible values: minimal, default, complete] - -c, --components ... + -c, --component ... Component name to also install - -t, --targets ... + -t, --target ... Target name to also install --no-update-default-toolchain Don't update any existing default toolchain after install