From 8f8f6b11f353f12b8a4018b8bc25aa02bc914955 Mon Sep 17 00:00:00 2001 From: Daniel Mueller Date: Sat, 29 Dec 2018 09:00:34 -0800 Subject: Move storage_* subcommand functions below storage command function We have kept the code organized such that the function for handling a command is located above the functions taking care of handling the subcommands. This change moves the storage_* subcommand functions below the storage function to be more consistent with existing code. --- nitrocli/src/args.rs | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/nitrocli/src/args.rs b/nitrocli/src/args.rs index d7a6d25..e7e7717 100644 --- a/nitrocli/src/args.rs +++ b/nitrocli/src/args.rs @@ -292,24 +292,6 @@ fn status(args: Vec) -> Result<()> { commands::status() } -/// Open the encrypted volume on the nitrokey. -fn storage_open(args: Vec) -> Result<()> { - let mut parser = argparse::ArgumentParser::new(); - parser.set_description("Opens the encrypted volume on a Nitrokey Storage"); - parse(&parser, args)?; - - commands::storage_open() -} - -/// Close the previously opened encrypted volume. -fn storage_close(args: Vec) -> Result<()> { - let mut parser = argparse::ArgumentParser::new(); - parser.set_description("Closes the encrypted volume on a Nitrokey Storage"); - parse(&parser, args)?; - - commands::storage_close() -} - #[derive(Debug)] enum StorageCommand { Close, @@ -374,6 +356,24 @@ fn storage(args: Vec) -> Result<()> { subcommand.execute(subargs) } +/// Open the encrypted volume on the nitrokey. +fn storage_open(args: Vec) -> Result<()> { + let mut parser = argparse::ArgumentParser::new(); + parser.set_description("Opens the encrypted volume on a Nitrokey Storage"); + parse(&parser, args)?; + + commands::storage_open() +} + +/// Close the previously opened encrypted volume. +fn storage_close(args: Vec) -> Result<()> { + let mut parser = argparse::ArgumentParser::new(); + parser.set_description("Closes the encrypted volume on a Nitrokey Storage"); + parse(&parser, args)?; + + commands::storage_close() +} + /// Clear the PIN as cached by various other commands. fn clear(args: Vec) -> Result<()> { let mut parser = argparse::ArgumentParser::new(); -- cgit v1.2.3