@@ -113,7 +113,7 @@ pub fn main() -> Result<()> {
113113}
114114
115115pub fn cli ( ) -> App < ' static , ' static > {
116- App :: new ( "rustup" )
116+ let mut app = App :: new ( "rustup" )
117117 . version ( common:: version ( ) )
118118 . about ( "The Rust toolchain installer" )
119119 . after_help ( RUSTUP_HELP )
@@ -330,52 +330,57 @@ pub fn cli() -> App<'static, 'static> {
330330 . long ( "std" )
331331 . help ( "Standard library API documentation" ) )
332332 . group ( ArgGroup :: with_name ( "page" )
333- . args ( & [ "book" , "std" ] ) ) )
334- . subcommand ( SubCommand :: with_name ( "man" )
333+ . args ( & [ "book" , "std" ] ) ) ) ;
334+
335+ if cfg ! ( not( target_os = "windows" ) ) {
336+ app = app
337+ . subcommand ( SubCommand :: with_name ( "man" )
335338 . about ( "View the man page for a given command" )
336339 . arg ( Arg :: with_name ( "command" )
337340 . required ( true ) )
338341 . arg ( Arg :: with_name ( "toolchain" )
339342 . long ( "toolchain" )
340- . takes_value ( true ) ) )
341- . subcommand ( SubCommand :: with_name ( "self" )
342- . about ( "Modify the rustup installation" )
343- . setting ( AppSettings :: VersionlessSubcommands )
344- . setting ( AppSettings :: DeriveDisplayOrder )
345- . setting ( AppSettings :: SubcommandRequiredElseHelp )
346- . subcommand ( SubCommand :: with_name ( "update" )
347- . about ( "Download and install updates to rustup" ) )
348- . subcommand ( SubCommand :: with_name ( "uninstall" )
349- . about ( "Uninstall rustup." )
350- . arg ( Arg :: with_name ( "no-prompt" )
351- . short ( "y" ) ) )
352- . subcommand ( SubCommand :: with_name ( "upgrade-data" )
353- . about ( "Upgrade the internal data format." ) ) )
354- . subcommand ( SubCommand :: with_name ( "telemetry" )
355- . about ( "rustup telemetry commands" )
356- . setting ( AppSettings :: Hidden )
357- . setting ( AppSettings :: VersionlessSubcommands )
358- . setting ( AppSettings :: DeriveDisplayOrder )
359- . setting ( AppSettings :: SubcommandRequiredElseHelp )
360- . subcommand ( SubCommand :: with_name ( "enable" )
361- . about ( "Enable rustup telemetry" ) )
362- . subcommand ( SubCommand :: with_name ( "disable" )
363- . about ( "Disable rustup telemetry" ) )
364- . subcommand ( SubCommand :: with_name ( "analyze" )
365- . about ( "Analyze stored telemetry" ) ) )
366- . subcommand ( SubCommand :: with_name ( "set" )
367- . about ( "Alter rustup settings" )
368- . setting ( AppSettings :: SubcommandRequiredElseHelp )
369- . subcommand ( SubCommand :: with_name ( "default-host" )
370- . about ( "The triple used to identify toolchains when not specified" )
371- . arg ( Arg :: with_name ( "host_triple" )
372- . required ( true ) ) ) )
373- . subcommand ( SubCommand :: with_name ( "completions" )
374- . about ( "Generate completion scripts for your shell" )
375- . after_help ( COMPLETIONS_HELP )
376- . setting ( AppSettings :: ArgRequiredElseHelp )
377- . arg ( Arg :: with_name ( "shell" )
378- . possible_values ( & Shell :: variants ( ) ) ) )
343+ . takes_value ( true ) ) ) ;
344+ }
345+
346+ app. subcommand ( SubCommand :: with_name ( "self" )
347+ . about ( "Modify the rustup installation" )
348+ . setting ( AppSettings :: VersionlessSubcommands )
349+ . setting ( AppSettings :: DeriveDisplayOrder )
350+ . setting ( AppSettings :: SubcommandRequiredElseHelp )
351+ . subcommand ( SubCommand :: with_name ( "update" )
352+ . about ( "Download and install updates to rustup" ) )
353+ . subcommand ( SubCommand :: with_name ( "uninstall" )
354+ . about ( "Uninstall rustup." )
355+ . arg ( Arg :: with_name ( "no-prompt" )
356+ . short ( "y" ) ) )
357+ . subcommand ( SubCommand :: with_name ( "upgrade-data" )
358+ . about ( "Upgrade the internal data format." ) ) )
359+ . subcommand ( SubCommand :: with_name ( "telemetry" )
360+ . about ( "rustup telemetry commands" )
361+ . setting ( AppSettings :: Hidden )
362+ . setting ( AppSettings :: VersionlessSubcommands )
363+ . setting ( AppSettings :: DeriveDisplayOrder )
364+ . setting ( AppSettings :: SubcommandRequiredElseHelp )
365+ . subcommand ( SubCommand :: with_name ( "enable" )
366+ . about ( "Enable rustup telemetry" ) )
367+ . subcommand ( SubCommand :: with_name ( "disable" )
368+ . about ( "Disable rustup telemetry" ) )
369+ . subcommand ( SubCommand :: with_name ( "analyze" )
370+ . about ( "Analyze stored telemetry" ) ) )
371+ . subcommand ( SubCommand :: with_name ( "set" )
372+ . about ( "Alter rustup settings" )
373+ . setting ( AppSettings :: SubcommandRequiredElseHelp )
374+ . subcommand ( SubCommand :: with_name ( "default-host" )
375+ . about ( "The triple used to identify toolchains when not specified" )
376+ . arg ( Arg :: with_name ( "host_triple" )
377+ . required ( true ) ) ) )
378+ . subcommand ( SubCommand :: with_name ( "completions" )
379+ . about ( "Generate completion scripts for your shell" )
380+ . after_help ( COMPLETIONS_HELP )
381+ . setting ( AppSettings :: ArgRequiredElseHelp )
382+ . arg ( Arg :: with_name ( "shell" )
383+ . possible_values ( & Shell :: variants ( ) ) ) )
379384}
380385
381386fn maybe_upgrade_data ( cfg : & Cfg , m : & ArgMatches ) -> Result < bool > {
0 commit comments