11use std:: fmt;
22use std:: io:: Write ;
33use std:: path:: { Path , PathBuf } ;
4- use std:: process;
54use std:: str:: FromStr ;
65
76use anyhow:: { anyhow, Error , Result } ;
@@ -24,7 +23,6 @@ use crate::{
2423 currentprocess:: {
2524 argsource:: ArgSource ,
2625 filesource:: { StderrSource , StdoutSource } ,
27- varsource:: VarSource ,
2826 } ,
2927 dist:: {
3028 dist:: { PartialToolchainDesc , Profile , TargetTriple } ,
@@ -212,6 +210,7 @@ pub fn main() -> Result<utils::ExitCode> {
212210 ( "run" , m) => run ( cfg, m) ?,
213211 ( "which" , m) => which ( cfg, m) ?,
214212 ( "doc" , m) => doc ( cfg, m) ?,
213+ #[ cfg( not( windows) ) ]
215214 ( "man" , m) => man ( cfg, m) ?,
216215 ( "self" , c) => match c. subcommand ( ) {
217216 Some ( s) => match s {
@@ -1615,7 +1614,10 @@ fn doc(cfg: &Cfg, m: &ArgMatches) -> Result<utils::ExitCode> {
16151614 }
16161615}
16171616
1617+ #[ cfg( not( windows) ) ]
16181618fn man ( cfg : & Cfg , m : & ArgMatches ) -> Result < utils:: ExitCode > {
1619+ use crate :: currentprocess:: varsource:: VarSource ;
1620+
16191621 let command = m. get_one :: < String > ( "command" ) . unwrap ( ) ;
16201622
16211623 let toolchain = explicit_desc_or_dir_toolchain ( cfg, m) ?;
@@ -1629,7 +1631,7 @@ fn man(cfg: &Cfg, m: &ArgMatches) -> Result<utils::ExitCode> {
16291631 if let Some ( path) = process ( ) . var_os ( "MANPATH" ) {
16301632 manpaths. push ( path) ;
16311633 }
1632- process:: Command :: new ( "man" )
1634+ std :: process:: Command :: new ( "man" )
16331635 . env ( "MANPATH" , manpaths)
16341636 . arg ( command)
16351637 . status ( )
0 commit comments