diff options
author | Daniel Mueller <deso@posteo.net> | 2019-07-14 15:53:25 -0700 |
---|---|---|
committer | Daniel Mueller <deso@posteo.net> | 2019-07-14 15:53:25 -0700 |
commit | 8cebc05e924c3b6c927a939bd45862a6ddf6edef (patch) | |
tree | 070658a3170a63121e18d5cc7fa2a8a2194685d6 /nitrocli/src/args.rs | |
parent | ba80a9087cc2ca91e81fdb9427213421567419ea (diff) | |
download | nitrocli-8cebc05e924c3b6c927a939bd45862a6ddf6edef.tar.gz nitrocli-8cebc05e924c3b6c927a939bd45862a6ddf6edef.tar.bz2 |
Include Nitrokey model in error message when no device is found
For functionality that explicitly works with the storage device we emit
an error message stating that a "Nitrokey Storage" device could not be
found. When the user chooses the model using the -m/--model argument
that is not the case.
With this patch we adjust the error message printed.
Diffstat (limited to 'nitrocli/src/args.rs')
-rw-r--r-- | nitrocli/src/args.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/nitrocli/src/args.rs b/nitrocli/src/args.rs index ae09c07..b83c495 100644 --- a/nitrocli/src/args.rs +++ b/nitrocli/src/args.rs @@ -108,6 +108,15 @@ Enum! {DeviceModel, [ Storage => "storage", ]} +impl DeviceModel { + pub fn as_user_facing_str(&self) -> &str { + match self { + DeviceModel::Pro => "Pro", + DeviceModel::Storage => "Storage", + } + } +} + impl From<DeviceModel> for nitrokey::Model { fn from(model: DeviceModel) -> nitrokey::Model { match model { |