aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mueller <deso@posteo.net>2018-12-29 09:00:34 -0800
committerDaniel Mueller <deso@posteo.net>2018-12-29 09:00:34 -0800
commit8f8f6b11f353f12b8a4018b8bc25aa02bc914955 (patch)
treee9d1c724eb9f7f6d473bd56ada382bff0b8613d9
parentc3b9df0dfa9ef2de2a800c4fbc5880a49da0d9bb (diff)
downloadnitrocli-8f8f6b11f353f12b8a4018b8bc25aa02bc914955.tar.gz
nitrocli-8f8f6b11f353f12b8a4018b8bc25aa02bc914955.tar.bz2
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.
-rw-r--r--nitrocli/src/args.rs36
1 files 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<String>) -> Result<()> {
commands::status()
}
-/// Open the encrypted volume on the nitrokey.
-fn storage_open(args: Vec<String>) -> 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<String>) -> 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<String>) -> Result<()> {
subcommand.execute(subargs)
}
+/// Open the encrypted volume on the nitrokey.
+fn storage_open(args: Vec<String>) -> 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<String>) -> 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<String>) -> Result<()> {
let mut parser = argparse::ArgumentParser::new();