diff --git a/rustup-init.sh b/rustup-init.sh index 46717ce205..cff65bf345 100755 --- a/rustup-init.sh +++ b/rustup-init.sh @@ -44,7 +44,7 @@ Options: Set log level to 'DEBUG' if 'RUSTUP_LOG' is unset -q, --quiet Disable progress output, set log level to 'WARN' if 'RUSTUP_LOG' is unset - -y + -y, --yes Disable confirmation prompt --default-host Choose a default host tuple @@ -134,6 +134,11 @@ main() { --quiet) RUSTUP_QUIET=yes ;; + --yes) + # user wants to skip the prompt -- + # we don't need /dev/tty + need_tty=no + ;; *) OPTIND=1 if [ "${arg%%--*}" = "" ]; then diff --git a/src/cli/rustup_mode.rs b/src/cli/rustup_mode.rs index aebd45e349..859d6b4217 100644 --- a/src/cli/rustup_mode.rs +++ b/src/cli/rustup_mode.rs @@ -556,7 +556,7 @@ enum SelfSubcmd { /// Uninstall rustup Uninstall { /// Disable confirmation prompt - #[arg(short = 'y')] + #[arg(short = 'y', long = "yes")] no_prompt: bool, /// Do not clean up the `PATH` environment variable diff --git a/src/cli/setup_mode.rs b/src/cli/setup_mode.rs index 178b1e7ee4..d36a2f95da 100644 --- a/src/cli/setup_mode.rs +++ b/src/cli/setup_mode.rs @@ -36,7 +36,7 @@ struct RustupInit { quiet: bool, /// Disable confirmation prompt - #[arg(short = 'y')] + #[arg(short = 'y', long = "yes")] no_prompt: bool, /// Choose a default host tuple diff --git a/tests/suite/cli_rustup_init_ui/rustup_init_help_flag.stdout.term.svg b/tests/suite/cli_rustup_init_ui/rustup_init_help_flag.stdout.term.svg index 1758f3b3ee..f4a6ff2f77 100644 --- a/tests/suite/cli_rustup_init_ui/rustup_init_help_flag.stdout.term.svg +++ b/tests/suite/cli_rustup_init_ui/rustup_init_help_flag.stdout.term.svg @@ -42,7 +42,7 @@ Disable progress output, set log level to 'WARN' if 'RUSTUP_LOG' is unset - -y + -y, --yes Disable confirmation prompt diff --git a/tests/suite/cli_rustup_init_ui/rustup_init_sh_help_flag.stdout.term.svg b/tests/suite/cli_rustup_init_ui/rustup_init_sh_help_flag.stdout.term.svg index 31b851c5f4..77a5394210 100644 --- a/tests/suite/cli_rustup_init_ui/rustup_init_sh_help_flag.stdout.term.svg +++ b/tests/suite/cli_rustup_init_ui/rustup_init_sh_help_flag.stdout.term.svg @@ -38,7 +38,7 @@ Disable progress output, set log level to 'WARN' if 'RUSTUP_LOG' is unset - -y + -y, --yes Disable confirmation prompt diff --git a/tests/suite/cli_rustup_ui/rustup_self_cmd_uninstall_cmd_help_flag.stdout.term.svg b/tests/suite/cli_rustup_ui/rustup_self_cmd_uninstall_cmd_help_flag.stdout.term.svg index 5a49ee07d1..4fe5be63ce 100644 --- a/tests/suite/cli_rustup_ui/rustup_self_cmd_uninstall_cmd_help_flag.stdout.term.svg +++ b/tests/suite/cli_rustup_ui/rustup_self_cmd_uninstall_cmd_help_flag.stdout.term.svg @@ -30,7 +30,7 @@ Options: - -y Disable confirmation prompt + -y, --yes Disable confirmation prompt --no-modify-path Do not clean up the `PATH` environment variable