Skip to content

Commit

Permalink
Auto merge of #1139 - kichristensen:DisableManOnWindows, r=Diggsey
Browse files Browse the repository at this point in the history
Disable man support on Windows

Disable man support on Windows.

closes #637
  • Loading branch information
bors committed Jun 3, 2017
2 parents 5241a88 + 285e858 commit 36936ea
Showing 1 changed file with 47 additions and 42 deletions.
89 changes: 47 additions & 42 deletions src/rustup-cli/rustup_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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<bool> {
Expand Down

0 comments on commit 36936ea

Please sign in to comment.