From a60b03f58437e358b24a96a4e6b2a2c11d277e6b Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Tue, 14 Jan 2020 19:32:28 +0100 Subject: Add scaffolding for the list command This patch adds the basic scaffolding for the list command which will list all attached Nitrokey devices. --- src/args.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/args.rs') diff --git a/src/args.rs b/src/args.rs index aeedfe6..91bddc5 100644 --- a/src/args.rs +++ b/src/args.rs @@ -117,6 +117,8 @@ Command! {Command, [ Encrypted(EncryptedArgs) => |ctx, args: EncryptedArgs| args.subcmd.execute(ctx), /// Interacts with the device's hidden volume Hidden(HiddenArgs) => |ctx, args: HiddenArgs| args.subcmd.execute(ctx), + /// Lists the attached Nitrokey devices + List(ListArgs) => |ctx, args: ListArgs| commands::list(ctx, args.no_connect), /// Locks the connected Nitrokey device Lock => commands::lock, /// Accesses one-time passwords @@ -263,6 +265,13 @@ struct HiddenCreateArgs { end: u8, } +#[derive(Debug, PartialEq, structopt::StructOpt)] +struct ListArgs { + /// Only print the information that is available without connecting to a device + #[structopt(short, long)] + no_connect: bool, +} + #[derive(Debug, PartialEq, structopt::StructOpt)] struct OtpArgs { #[structopt(subcommand)] -- cgit v1.2.1