diff options
Diffstat (limited to 'ipfs-cli/src/command/shutdown.rs')
-rw-r--r-- | ipfs-cli/src/command/shutdown.rs | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/ipfs-cli/src/command/shutdown.rs b/ipfs-cli/src/command/shutdown.rs index 6cb9c1d..e32b7f1 100644 --- a/ipfs-cli/src/command/shutdown.rs +++ b/ipfs-cli/src/command/shutdown.rs @@ -7,17 +7,24 @@ // use clap::App; -use command::EXPECTED_API; -use ipfs_api::IpfsClient; -use tokio_core::reactor::Core; +use command::CliCommand; +use futures::Future; -pub fn signature<'a, 'b>() -> App<'a, 'b> { - clap_app!( - @subcommand shutdown => - (about: "Shutdown IPFS daemon") - ) -} +pub struct Command; + +impl CliCommand for Command { + const NAME: &'static str = "shutdown"; + + fn signature<'a, 'b>() -> App<'a, 'b> { + clap_app!( + @subcommand shutdown => + (about: "Shutdown IPFS daemon") + ) + } -pub fn handle(core: &mut Core, client: &IpfsClient) { - core.run(client.shutdown()).expect(EXPECTED_API); + handle!( + (_args, client) => { + client.shutdown().map(|_| ()) + } + ); } |