diff options
author | Robin Krahl <robin.krahl@ireas.org> | 2020-09-19 15:04:18 +0200 |
---|---|---|
committer | Daniel Mueller <deso@posteo.net> | 2020-09-20 10:50:26 -0700 |
commit | d5c357e4564318577cf7e36d0f29b566f61dc825 (patch) | |
tree | 3d2d95abef64a342e757509bab29e7482398f370 /src/args.rs | |
parent | 57a177e2f946390559a1f17787c5a15d23ac3393 (diff) | |
download | nitrocli-d5c357e4564318577cf7e36d0f29b566f61dc825.tar.gz nitrocli-d5c357e4564318577cf7e36d0f29b566f61dc825.tar.bz2 |
Add the --progress option to the fill command
The fill command starts a background operation on a Nitrokey Storage
device that fills the SD card with random data. This patch adds a new
option, --progress, to the fill command that checks if a fill operation
is already running on the device and shows its progress.
Diffstat (limited to 'src/args.rs')
-rw-r--r-- | src/args.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/args.rs b/src/args.rs index 4947825..8af38ca 100644 --- a/src/args.rs +++ b/src/args.rs @@ -80,7 +80,7 @@ Command! { /// Interacts with the device's encrypted volume Encrypted(EncryptedArgs) => |ctx, args: EncryptedArgs| args.subcmd.execute(ctx), /// Fills the SD card with random data - Fill => crate::commands::fill, + Fill(FillArgs) => |ctx, args: FillArgs| crate::commands::fill(ctx, args.attach), /// Interacts with the device's hidden volume Hidden(HiddenArgs) => |ctx, args: HiddenArgs| args.subcmd.execute(ctx), /// Lists the attached Nitrokey devices @@ -190,6 +190,14 @@ Command! {EncryptedCommand, [ ]} #[derive(Debug, PartialEq, structopt::StructOpt)] +pub struct FillArgs { + /// Checks if a fill operation is already running and show its progress instead of starting a new + /// operation. + #[structopt(short, long)] + attach: bool, +} + +#[derive(Debug, PartialEq, structopt::StructOpt)] pub struct HiddenArgs { #[structopt(subcommand)] subcmd: HiddenCommand, |