1
1
use std:: fmt;
2
2
use std:: io:: Write ;
3
3
use std:: path:: { Path , PathBuf } ;
4
- use std:: process;
5
4
use std:: str:: FromStr ;
6
5
7
6
use anyhow:: { anyhow, Error , Result } ;
@@ -24,7 +23,6 @@ use crate::{
24
23
currentprocess:: {
25
24
argsource:: ArgSource ,
26
25
filesource:: { StderrSource , StdoutSource } ,
27
- varsource:: VarSource ,
28
26
} ,
29
27
dist:: {
30
28
dist:: { PartialToolchainDesc , Profile , TargetTriple } ,
@@ -212,6 +210,7 @@ pub fn main() -> Result<utils::ExitCode> {
212
210
( "run" , m) => run ( cfg, m) ?,
213
211
( "which" , m) => which ( cfg, m) ?,
214
212
( "doc" , m) => doc ( cfg, m) ?,
213
+ #[ cfg( not( windows) ) ]
215
214
( "man" , m) => man ( cfg, m) ?,
216
215
( "self" , c) => match c. subcommand ( ) {
217
216
Some ( s) => match s {
@@ -1615,7 +1614,10 @@ fn doc(cfg: &Cfg, m: &ArgMatches) -> Result<utils::ExitCode> {
1615
1614
}
1616
1615
}
1617
1616
1617
+ #[ cfg( not( windows) ) ]
1618
1618
fn man ( cfg : & Cfg , m : & ArgMatches ) -> Result < utils:: ExitCode > {
1619
+ use crate :: currentprocess:: varsource:: VarSource ;
1620
+
1619
1621
let command = m. get_one :: < String > ( "command" ) . unwrap ( ) ;
1620
1622
1621
1623
let toolchain = explicit_desc_or_dir_toolchain ( cfg, m) ?;
@@ -1629,7 +1631,7 @@ fn man(cfg: &Cfg, m: &ArgMatches) -> Result<utils::ExitCode> {
1629
1631
if let Some ( path) = process ( ) . var_os ( "MANPATH" ) {
1630
1632
manpaths. push ( path) ;
1631
1633
}
1632
- process:: Command :: new ( "man" )
1634
+ std :: process:: Command :: new ( "man" )
1633
1635
. env ( "MANPATH" , manpaths)
1634
1636
. arg ( command)
1635
1637
. status ( )
0 commit comments