diff --git a/src/rustup-cli/help.rs b/src/rustup-cli/help.rs index 9a7ff5fc2a3..7e8f8d4bd4e 100644 --- a/src/rustup-cli/help.rs +++ b/src/rustup-cli/help.rs @@ -26,21 +26,13 @@ r"DISCUSSION: updates rustup itself. If given a toolchain argument then `update` updates that - toolchain, the same as `rustup toolchain install`. - - 'toolchain' specifies a toolchain name, such as 'stable', - 'nightly', or '1.8.0'. For more information see `rustup help - toolchain`."; + toolchain, the same as `rustup toolchain install`."; pub static INSTALL_HELP: &'static str = r"DISCUSSION: Installs a specific rust toolchain. - The 'install' command is an alias for 'rustup update '. - - 'toolchain' specifies a toolchain name, such as 'stable', - 'nightly', or '1.8.0'. For more information see `rustup help - toolchain`."; + The 'install' command is an alias for 'rustup update '."; pub static DEFAULT_HELP: &'static str = r"DISCUSSION: @@ -262,3 +254,8 @@ r"DISCUSSION: completions into our profile simply use `PS C:\> rustup completions powershell >> %USERPROFILE%\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1`"; + +pub static TOOLCHAIN_ARG_HELP: &'static str = + "Toolchain name, such as 'stable', 'nightly', \ + or '1.8.0'. For more information see `rustup \ + help toolchain`"; diff --git a/src/rustup-cli/rustup_mode.rs b/src/rustup-cli/rustup_mode.rs index 0c585a1a7e4..921fd251713 100644 --- a/src/rustup-cli/rustup_mode.rs +++ b/src/rustup-cli/rustup_mode.rs @@ -132,18 +132,21 @@ pub fn cli() -> App<'static, 'static> { .after_help(INSTALL_HELP) .setting(AppSettings::Hidden) // synonym for 'toolchain install' .arg(Arg::with_name("toolchain") + .help(TOOLCHAIN_ARG_HELP) .required(true) .multiple(true))) .subcommand(SubCommand::with_name("uninstall") .about("Uninstall Rust toolchains") .setting(AppSettings::Hidden) // synonym for 'toolchain uninstall' .arg(Arg::with_name("toolchain") + .help(TOOLCHAIN_ARG_HELP) .required(true) .multiple(true))) .subcommand(SubCommand::with_name("update") .about("Update Rust toolchains and rustup") .after_help(UPDATE_HELP) .arg(Arg::with_name("toolchain") + .help(TOOLCHAIN_ARG_HELP) .required(false) .multiple(true)) .arg(Arg::with_name("no-self-update") @@ -155,6 +158,7 @@ pub fn cli() -> App<'static, 'static> { .about("Set the default toolchain") .after_help(DEFAULT_HELP) .arg(Arg::with_name("toolchain") + .help(TOOLCHAIN_ARG_HELP) .required(true))) .subcommand(SubCommand::with_name("toolchain") .about("Modify or query the installed toolchains") @@ -167,33 +171,39 @@ pub fn cli() -> App<'static, 'static> { .subcommand(SubCommand::with_name("install") .about("Install or update a given toolchain") .arg(Arg::with_name("toolchain") + .help(TOOLCHAIN_ARG_HELP) .required(true) .multiple(true))) .subcommand(SubCommand::with_name("uninstall") .about("Uninstall a toolchain") .arg(Arg::with_name("toolchain") + .help(TOOLCHAIN_ARG_HELP) .required(true) .multiple(true))) .subcommand(SubCommand::with_name("link") .about("Create a custom toolchain by symlinking to a directory") .after_help(TOOLCHAIN_LINK_HELP) .arg(Arg::with_name("toolchain") + .help(TOOLCHAIN_ARG_HELP) .required(true)) .arg(Arg::with_name("path") .required(true))) .subcommand(SubCommand::with_name("update") .setting(AppSettings::Hidden) // synonym for 'install' .arg(Arg::with_name("toolchain") + .help(TOOLCHAIN_ARG_HELP) .required(true) .multiple(true))) .subcommand(SubCommand::with_name("add") .setting(AppSettings::Hidden) // synonym for 'install' .arg(Arg::with_name("toolchain") + .help(TOOLCHAIN_ARG_HELP) .required(true) .multiple(true))) .subcommand(SubCommand::with_name("remove") .setting(AppSettings::Hidden) // synonym for 'uninstall' .arg(Arg::with_name("toolchain") + .help(TOOLCHAIN_ARG_HELP) .required(true) .multiple(true)))) .subcommand(SubCommand::with_name("target") @@ -204,6 +214,7 @@ pub fn cli() -> App<'static, 'static> { .subcommand(SubCommand::with_name("list") .about("List installed and available targets") .arg(Arg::with_name("toolchain") + .help(TOOLCHAIN_ARG_HELP) .long("toolchain") .takes_value(true))) .subcommand(SubCommand::with_name("add") @@ -212,6 +223,7 @@ pub fn cli() -> App<'static, 'static> { .required(true) .multiple(true)) .arg(Arg::with_name("toolchain") + .help(TOOLCHAIN_ARG_HELP) .long("toolchain") .takes_value(true))) .subcommand(SubCommand::with_name("remove") @@ -220,6 +232,7 @@ pub fn cli() -> App<'static, 'static> { .required(true) .multiple(true)) .arg(Arg::with_name("toolchain") + .help(TOOLCHAIN_ARG_HELP) .long("toolchain") .takes_value(true))) .subcommand(SubCommand::with_name("install") @@ -228,6 +241,7 @@ pub fn cli() -> App<'static, 'static> { .required(true) .multiple(true)) .arg(Arg::with_name("toolchain") + .help(TOOLCHAIN_ARG_HELP) .long("toolchain") .takes_value(true))) .subcommand(SubCommand::with_name("uninstall") @@ -236,6 +250,7 @@ pub fn cli() -> App<'static, 'static> { .required(true) .multiple(true)) .arg(Arg::with_name("toolchain") + .help(TOOLCHAIN_ARG_HELP) .long("toolchain") .takes_value(true)))) .subcommand(SubCommand::with_name("component") @@ -246,6 +261,7 @@ pub fn cli() -> App<'static, 'static> { .subcommand(SubCommand::with_name("list") .about("List installed and available components") .arg(Arg::with_name("toolchain") + .help(TOOLCHAIN_ARG_HELP) .long("toolchain") .takes_value(true))) .subcommand(SubCommand::with_name("add") @@ -254,6 +270,7 @@ pub fn cli() -> App<'static, 'static> { .required(true) .multiple(true)) .arg(Arg::with_name("toolchain") + .help(TOOLCHAIN_ARG_HELP) .long("toolchain") .takes_value(true)) .arg(Arg::with_name("target") @@ -265,6 +282,7 @@ pub fn cli() -> App<'static, 'static> { .required(true) .multiple(true)) .arg(Arg::with_name("toolchain") + .help(TOOLCHAIN_ARG_HELP) .long("toolchain") .takes_value(true)) .arg(Arg::with_name("target") @@ -281,6 +299,7 @@ pub fn cli() -> App<'static, 'static> { .subcommand(SubCommand::with_name("set") .about("Set the override toolchain for a directory") .arg(Arg::with_name("toolchain") + .help(TOOLCHAIN_ARG_HELP) .required(true))) .subcommand(SubCommand::with_name("unset") .about("Remove the override toolchain for a directory") @@ -296,6 +315,7 @@ pub fn cli() -> App<'static, 'static> { .subcommand(SubCommand::with_name("add") .setting(AppSettings::Hidden) // synonym for 'set' .arg(Arg::with_name("toolchain") + .help(TOOLCHAIN_ARG_HELP) .required(true))) .subcommand(SubCommand::with_name("remove") .setting(AppSettings::Hidden) // synonym for 'unset' @@ -312,6 +332,7 @@ pub fn cli() -> App<'static, 'static> { .after_help(RUN_HELP) .setting(AppSettings::TrailingVarArg) .arg(Arg::with_name("toolchain") + .help(TOOLCHAIN_ARG_HELP) .required(true)) .arg(Arg::with_name("command") .required(true).multiple(true).use_delimiter(false))) @@ -339,6 +360,7 @@ pub fn cli() -> App<'static, 'static> { .arg(Arg::with_name("command") .required(true)) .arg(Arg::with_name("toolchain") + .help(TOOLCHAIN_ARG_HELP) .long("toolchain") .takes_value(true))); }