diff options
Diffstat (limited to 'ipfs-cli/src/command/cat.rs')
-rw-r--r-- | ipfs-cli/src/command/cat.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/ipfs-cli/src/command/cat.rs b/ipfs-cli/src/command/cat.rs index 559bd24..6216bc7 100644 --- a/ipfs-cli/src/command/cat.rs +++ b/ipfs-cli/src/command/cat.rs @@ -10,6 +10,7 @@ use clap::{App, ArgMatches}; use command::EXPECTED_API; use futures::stream::Stream; use ipfs_api::IpfsClient; +use std::io::{self, Write}; use tokio_core::reactor::Core; @@ -25,9 +26,7 @@ pub fn signature<'a, 'b>() -> App<'a, 'b> { pub fn handle(core: &mut Core, client: &IpfsClient, args: &ArgMatches) { let path = args.value_of("PATH").unwrap(); let req = client.cat(&path).for_each(|chunk| { - println!("{}", String::from_utf8_lossy(&chunk)); - - Ok(()) + io::stdout().write_all(&chunk).map_err(From::from) }); core.run(req).expect(EXPECTED_API); |