diff --git a/src/cli/help.rs b/src/cli/help.rs index 3a1d2f7529..75bb8e3ca8 100644 --- a/src/cli/help.rs +++ b/src/cli/help.rs @@ -216,6 +216,15 @@ pub(crate) fn run_help() -> String { ) } +pub(crate) fn check_help() -> String { + format!( + r"{HEADER}Exit status:{HEADER:#} + {LITERAL}0{LITERAL:#} Everything is up to date. + {LITERAL}100{LITERAL:#} At least one update is available. + {LITERAL}1{LITERAL:#} An error occurred." + ) +} + pub(crate) fn doc_help() -> String { format!( r"{HEADER}Discussion:{HEADER:#} diff --git a/src/cli/rustup_mode.rs b/src/cli/rustup_mode.rs index b81d26f23c..2bc4ffd802 100644 --- a/src/cli/rustup_mode.rs +++ b/src/cli/rustup_mode.rs @@ -28,7 +28,7 @@ use crate::{ common::{self, PackageUpdate, update_console_filter}, errors::CliError, help::{ - completions_help, default_help, doc_help, install_help, + check_help, completions_help, default_help, doc_help, install_help, maybe_resolvable_toolchain_arg_help, official_toolchain_arg_help, override_help, override_unset_help, resolvable_local_toolchain_arg_help, resolvable_toolchain_arg_help, run_help, rustup_help, show_active_toolchain_help, @@ -192,6 +192,7 @@ enum RustupSubcmd { }, /// Check for updates to Rust toolchains and rustup + #[command(after_help = check_help())] Check { #[command(flatten)] opts: CheckOpts, diff --git a/tests/suite/cli_rustup_ui/rustup_check_cmd_help_flag.stdout.term.svg b/tests/suite/cli_rustup_ui/rustup_check_cmd_help_flag.stdout.term.svg index 9243a6a1e2..35f8114209 100644 --- a/tests/suite/cli_rustup_ui/rustup_check_cmd_help_flag.stdout.term.svg +++ b/tests/suite/cli_rustup_ui/rustup_check_cmd_help_flag.stdout.term.svg @@ -1,4 +1,4 @@ - +