mm(1): makes -e block inferring stdout as an output, mm.1: reflects changes to -e
This commit is contained in:
parent
8d693b6664
commit
20692d581a
|
@ -33,7 +33,9 @@ Opens a path as an input. If one or more of the input files is \(lq-\(rq or if
|
|||
no inputs are specified, the standard input shall be used.
|
||||
.IP \fB-o\fP\ \fIoutput\fP
|
||||
Opens a path as an output. If one or more of the output files is \(lq-\(rq or if
|
||||
no outputs are specified, the standard output shall be used.
|
||||
no outputs are specified and the
|
||||
.B -e
|
||||
option is not specified, the standard output shall be used.
|
||||
.\"
|
||||
.SH DIAGNOSTICS
|
||||
|
||||
|
|
13
src/mm.rs
13
src/mm.rs
|
@ -68,7 +68,7 @@ fn main() -> ExitCode {
|
|||
if ins.is_empty() { ins.push("-".to_string()); }
|
||||
|
||||
/* use stdout if no outputs are specified */
|
||||
if outs.is_empty() { outs.push("-".to_string()); }
|
||||
if outs.is_empty() && !e { outs.push("-".to_string()); }
|
||||
|
||||
/* map all path strings to files */
|
||||
let inputs = ins.iter().map(|file| {
|
||||
|
@ -142,10 +142,13 @@ fn main() -> ExitCode {
|
|||
eprintln!("{}: {}", argv[0], e.strerror());
|
||||
return ExitCode::from(EX_IOERR as u8);
|
||||
}
|
||||
/* immediately flush the output for -u */
|
||||
if let Err(e) = out.flush() {
|
||||
eprintln!("{}: {}", argv[0], e.strerror());
|
||||
return ExitCode::from(EX_IOERR as u8);
|
||||
|
||||
if u {
|
||||
/* immediately flush the output for -u */
|
||||
if let Err(e) = out.flush() {
|
||||
eprintln!("{}: {}", argv[0], e.strerror());
|
||||
return ExitCode::from(EX_IOERR as u8);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user