diff options
Diffstat (limited to 'ipfs-cli/src/command/diag.rs')
-rw-r--r-- | ipfs-cli/src/command/diag.rs | 46 |
1 files changed, 22 insertions, 24 deletions
diff --git a/ipfs-cli/src/command/diag.rs b/ipfs-cli/src/command/diag.rs index 644de19..7ce6c22 100644 --- a/ipfs-cli/src/command/diag.rs +++ b/ipfs-cli/src/command/diag.rs @@ -11,16 +11,18 @@ use command::EXPECTED_API; use ipfs_api::IpfsClient; use tokio_core::reactor::Core; - pub fn signature<'a, 'b>() -> App<'a, 'b> { // The clap macro does not allow hyphenated command names, // so the `set-time` command has to be manually instantiated. // let set_time_command = SubCommand::with_name("set-time") .about("Set how long to keep inactive requests in the log") - .arg(Arg::with_name("TIME").required(true).index(1).help( - "Time to keep inactive requests in the log", - )); + .arg( + Arg::with_name("TIME") + .required(true) + .index(1) + .help("Time to keep inactive requests in the log"), + ); clap_app!( @subcommand diag => @@ -38,32 +40,28 @@ pub fn signature<'a, 'b>() -> App<'a, 'b> { ) } - pub fn handle(core: &mut Core, client: &IpfsClient, args: &ArgMatches) { match args.subcommand() { - ("cmds", Some(args)) => { - match args.subcommand() { - ("clear", _) => { - core.run(client.diag_cmds_clear()).expect(EXPECTED_API); + ("cmds", Some(args)) => match args.subcommand() { + ("clear", _) => { + core.run(client.diag_cmds_clear()).expect(EXPECTED_API); - println!(); - println!(" OK"); - println!(); - } - ("set-time", Some(args)) => { - let time = args.value_of("TIME").unwrap(); + println!(""); + println!(" OK"); + println!(""); + } + ("set-time", Some(args)) => { + let time = args.value_of("TIME").unwrap(); - core.run(client.diag_cmds_set_time(time)).expect( - EXPECTED_API, - ); + core.run(client.diag_cmds_set_time(&time)) + .expect(EXPECTED_API); - println!(); - println!(" OK"); - println!(); - } - _ => unreachable!(), + println!(""); + println!(" OK"); + println!(""); } - } + _ => unreachable!(), + }, ("sys", _) => { let sys = core.run(client.diag_sys()).expect(EXPECTED_API); |