From eae8b2a1f0d1faf70776fccc12c93267a2143021 Mon Sep 17 00:00:00 2001 From: Daniel Mueller Date: Fri, 10 Apr 2020 12:20:18 -0700 Subject: Merge otp_set function into commands.rs Now that we have isolated and separated out structopt specific definitions into a new module, arg_defs, args.rs is actually so small that we do not want to keep it around any longer. This change marks a first step moving us closer towards removing it. Specifically, it merges the otp_set function from args.rs into the function of the same name in commands.rs. --- src/args.rs | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'src/args.rs') diff --git a/src/args.rs b/src/args.rs index 720fabf..3a1f2c8 100644 --- a/src/args.rs +++ b/src/args.rs @@ -82,25 +82,6 @@ pub fn config_set(ctx: &mut ExecCtx<'_>, args: arg_defs::ConfigSetArgs) -> Resul commands::config_set(ctx, numlock, capslock, scrollock, otp_pin) } -pub fn otp_set(ctx: &mut ExecCtx<'_>, args: arg_defs::OtpSetArgs) -> Result<()> { - let data = nitrokey::OtpSlotData { - number: args.slot, - name: args.name, - secret: args.secret, - mode: args.digits.into(), - use_enter: false, - token_id: None, - }; - commands::otp_set( - ctx, - data, - args.algorithm, - args.counter, - args.time_window, - args.format, - ) -} - /// Parse the command-line arguments and execute the selected command. pub(crate) fn handle_arguments(ctx: &mut RunCtx<'_>, args: Vec) -> Result<()> { use structopt::StructOpt; -- cgit v1.2.1