aboutsummaryrefslogtreecommitdiff
path: root/src/args.rs
diff options
context:
space:
mode:
authorDaniel Mueller <deso@posteo.net>2020-04-10 12:20:18 -0700
committerDaniel Mueller <deso@posteo.net>2020-04-10 12:20:18 -0700
commiteae8b2a1f0d1faf70776fccc12c93267a2143021 (patch)
tree57285013a7efa36ebeac9a25300412a731eb355d /src/args.rs
parent95358de8ec4e2c9fb7254d65fb9147fb118e2f78 (diff)
downloadnitrocli-eae8b2a1f0d1faf70776fccc12c93267a2143021.tar.gz
nitrocli-eae8b2a1f0d1faf70776fccc12c93267a2143021.tar.bz2
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.
Diffstat (limited to 'src/args.rs')
-rw-r--r--src/args.rs19
1 files changed, 0 insertions, 19 deletions
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<String>) -> Result<()> {
use structopt::StructOpt;