diff options
author | Daniel Mueller <deso@posteo.net> | 2019-01-12 11:14:27 -0800 |
---|---|---|
committer | Daniel Mueller <deso@posteo.net> | 2019-01-12 11:14:27 -0800 |
commit | 4f2416011a565e5e579f1f3e6387a7344f89d96d (patch) | |
tree | ac7c2f677457264d08c3fde1f6720960528699ea /nitrocli/src/args.rs | |
parent | e977016e668a8db528d67d77c4e3dc7fe62423e5 (diff) | |
download | nitrocli-4f2416011a565e5e579f1f3e6387a7344f89d96d.tar.gz nitrocli-4f2416011a565e5e579f1f3e6387a7344f89d96d.tar.bz2 |
Produce JSON formatted status
Diffstat (limited to 'nitrocli/src/args.rs')
-rw-r--r-- | nitrocli/src/args.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/nitrocli/src/args.rs b/nitrocli/src/args.rs index 2e56e9e..67f6abf 100644 --- a/nitrocli/src/args.rs +++ b/nitrocli/src/args.rs @@ -329,11 +329,17 @@ fn parse( /// Inquire the status of the Nitrokey. fn status(ctx: &mut ExecCtx<'_>, args: Vec<String>) -> Result<()> { + let mut json = false; let mut parser = argparse::ArgumentParser::new(); parser.set_description("Prints the status of the connected Nitrokey device"); + let _ = parser.refer(&mut json).add_option( + &["--json"], + argparse::StoreTrue, + "Emit status output in JSON format", + ); parse(ctx, parser, args)?; - commands::status(ctx) + commands::status(ctx, json) } /// Perform a factory reset. |