diff options
Diffstat (limited to 'nitrocli/src/args.rs')
-rw-r--r-- | nitrocli/src/args.rs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/nitrocli/src/args.rs b/nitrocli/src/args.rs index 253d5a0..298b157 100644 --- a/nitrocli/src/args.rs +++ b/nitrocli/src/args.rs @@ -91,9 +91,9 @@ enum ConfigCommand { } impl ConfigCommand { - fn execute(&self, _args: Vec<String>) -> Result<()> { + fn execute(&self, args: Vec<String>) -> Result<()> { match *self { - ConfigCommand::Get => Err(Error::Error("Not implemented".to_string())), + ConfigCommand::Get => config_get(args), } } } @@ -308,6 +308,15 @@ fn config(args: Vec<String>) -> Result<()> { subcommand.execute(subargs) } +/// Read the Nitrokey configuration. +fn config_get(args: Vec<String>) -> Result<()> { + let mut parser = argparse::ArgumentParser::new(); + parser.set_description("Prints the Nitrokey configuration"); + parse(&parser, args)?; + + commands::config_get() +} + /// Execute an OTP subcommand. fn otp(args: Vec<String>) -> Result<()> { let mut subcommand = OtpCommand::Get; |