From 285e858f6d263929aa82a2770ed892e3173ac9e9 Mon Sep 17 00:00:00 2001 From: Kim Christensen Date: Mon, 29 May 2017 15:58:02 +0200 Subject: [PATCH] Disable man support on Windows --- src/rustup-cli/rustup_mode.rs | 89 ++++++++++++++++++----------------- 1 file changed, 47 insertions(+), 42 deletions(-) diff --git a/src/rustup-cli/rustup_mode.rs b/src/rustup-cli/rustup_mode.rs index ce6c228f7c6..0c585a1a7e4 100644 --- a/src/rustup-cli/rustup_mode.rs +++ b/src/rustup-cli/rustup_mode.rs @@ -113,7 +113,7 @@ pub fn main() -> Result<()> { } pub fn cli() -> App<'static, 'static> { - App::new("rustup") + let mut app = App::new("rustup") .version(common::version()) .about("The Rust toolchain installer") .after_help(RUSTUP_HELP) @@ -330,52 +330,57 @@ pub fn cli() -> App<'static, 'static> { .long("std") .help("Standard library API documentation")) .group(ArgGroup::with_name("page") - .args(&["book", "std"]))) - .subcommand(SubCommand::with_name("man") + .args(&["book", "std"]))); + + if cfg!(not(target_os = "windows")) { + app = app + .subcommand(SubCommand::with_name("man") .about("View the man page for a given command") .arg(Arg::with_name("command") .required(true)) .arg(Arg::with_name("toolchain") .long("toolchain") - .takes_value(true))) - .subcommand(SubCommand::with_name("self") - .about("Modify the rustup installation") - .setting(AppSettings::VersionlessSubcommands) - .setting(AppSettings::DeriveDisplayOrder) - .setting(AppSettings::SubcommandRequiredElseHelp) - .subcommand(SubCommand::with_name("update") - .about("Download and install updates to rustup")) - .subcommand(SubCommand::with_name("uninstall") - .about("Uninstall rustup.") - .arg(Arg::with_name("no-prompt") - .short("y"))) - .subcommand(SubCommand::with_name("upgrade-data") - .about("Upgrade the internal data format."))) - .subcommand(SubCommand::with_name("telemetry") - .about("rustup telemetry commands") - .setting(AppSettings::Hidden) - .setting(AppSettings::VersionlessSubcommands) - .setting(AppSettings::DeriveDisplayOrder) - .setting(AppSettings::SubcommandRequiredElseHelp) - .subcommand(SubCommand::with_name("enable") - .about("Enable rustup telemetry")) - .subcommand(SubCommand::with_name("disable") - .about("Disable rustup telemetry")) - .subcommand(SubCommand::with_name("analyze") - .about("Analyze stored telemetry"))) - .subcommand(SubCommand::with_name("set") - .about("Alter rustup settings") - .setting(AppSettings::SubcommandRequiredElseHelp) - .subcommand(SubCommand::with_name("default-host") - .about("The triple used to identify toolchains when not specified") - .arg(Arg::with_name("host_triple") - .required(true)))) - .subcommand(SubCommand::with_name("completions") - .about("Generate completion scripts for your shell") - .after_help(COMPLETIONS_HELP) - .setting(AppSettings::ArgRequiredElseHelp) - .arg(Arg::with_name("shell") - .possible_values(&Shell::variants()))) + .takes_value(true))); + } + + app.subcommand(SubCommand::with_name("self") + .about("Modify the rustup installation") + .setting(AppSettings::VersionlessSubcommands) + .setting(AppSettings::DeriveDisplayOrder) + .setting(AppSettings::SubcommandRequiredElseHelp) + .subcommand(SubCommand::with_name("update") + .about("Download and install updates to rustup")) + .subcommand(SubCommand::with_name("uninstall") + .about("Uninstall rustup.") + .arg(Arg::with_name("no-prompt") + .short("y"))) + .subcommand(SubCommand::with_name("upgrade-data") + .about("Upgrade the internal data format."))) + .subcommand(SubCommand::with_name("telemetry") + .about("rustup telemetry commands") + .setting(AppSettings::Hidden) + .setting(AppSettings::VersionlessSubcommands) + .setting(AppSettings::DeriveDisplayOrder) + .setting(AppSettings::SubcommandRequiredElseHelp) + .subcommand(SubCommand::with_name("enable") + .about("Enable rustup telemetry")) + .subcommand(SubCommand::with_name("disable") + .about("Disable rustup telemetry")) + .subcommand(SubCommand::with_name("analyze") + .about("Analyze stored telemetry"))) + .subcommand(SubCommand::with_name("set") + .about("Alter rustup settings") + .setting(AppSettings::SubcommandRequiredElseHelp) + .subcommand(SubCommand::with_name("default-host") + .about("The triple used to identify toolchains when not specified") + .arg(Arg::with_name("host_triple") + .required(true)))) + .subcommand(SubCommand::with_name("completions") + .about("Generate completion scripts for your shell") + .after_help(COMPLETIONS_HELP) + .setting(AppSettings::ArgRequiredElseHelp) + .arg(Arg::with_name("shell") + .possible_values(&Shell::variants()))) } fn maybe_upgrade_data(cfg: &Cfg, m: &ArgMatches) -> Result {