chiark
/
gitweb
/
~ianmdlvl
/
otter.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a1694db
)
otter cli: Switch to CookedStdout for arg parsing
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Tue, 1 Jun 2021 12:54:18 +0000
(13:54 +0100)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Tue, 1 Jun 2021 14:47:10 +0000
(15:47 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/bin/otter.rs
patch
|
blob
|
history
diff --git
a/src/bin/otter.rs
b/src/bin/otter.rs
index b592533525fc186c08a04631e5bd1ff11f719bf3..16494e64f8f163a1febb45ccb0dbd18835780e3b 100644
(file)
--- a/
src/bin/otter.rs
+++ b/
src/bin/otter.rs
@@
-175,7
+175,7
@@
fn parse_args<T:Default,U>(
let ap = apmaker(&mut parsed);
let us = args.get(0).expect("argv[0] must be provided!").clone();
- let mut stdout =
io::stdout
();
+ let mut stdout =
CookedStdout::new
();
let mut stderr = io::stderr();
let r = ap.parse(args, &mut stdout, &mut stderr);
@@
-783,8
+783,9
@@
mod list_games {
x => throw!(anyhow!("unexpected response to ListGames: {:?}", &x)),
};
games.sort();
+ let mut out = CookedStdout::new();
for g in games {
-
println!("{}", &g)
;
+
writeln!(out, "{}", &g)?
;
}
Ok(())
}