diff --git a/Cargo.lock b/Cargo.lock index 83916552..5555f8ba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -49,15 +49,52 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "2.33.3" +version = "2.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002" +checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" dependencies = [ "bitflags", - "textwrap", + "textwrap 0.11.0", "unicode-width", ] +[[package]] +name = "clap" +version = "3.0.0-rc.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "098d281b47bf725a0bddd829e0070ee76560faab8af123050a86c440d7f0a1fd" +dependencies = [ + "bitflags", + "clap_derive", + "indexmap", + "lazy_static", + "os_str_bytes", + "textwrap 0.14.2", + "unicase", +] + +[[package]] +name = "clap_derive" +version = "3.0.0-rc.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26de8102ffb96701066cea36f9a104285b67fbcc302a520640289d476c15ed8a" +dependencies = [ + "heck", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_generate" +version = "3.0.0-rc.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6348a4d94b0a7554e2725a77db6c6e2f897688f77230c083f51856ef021eb7d" +dependencies = [ + "clap 3.0.0-rc.3", +] + [[package]] name = "console" version = "0.14.1" @@ -241,6 +278,8 @@ version = "0.4.1" dependencies = [ "anyhow", "base32", + "clap 3.0.0-rc.3", + "clap_generate", "directories", "envy", "insta", @@ -311,6 +350,15 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8f8bdf33df195859076e54ab11ee78a1b208382d3a26ec40d142ffc1ecc49ef" +[[package]] +name = "os_str_bytes" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e22443d1643a904602595ba1cd8f7d896afe56d26712531c5ff73a15b2fbf64" +dependencies = [ + "memchr", +] + [[package]] name = "ppv-lite86" version = "0.2.10" @@ -343,9 +391,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.26" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152013215dca273577e18d2bf00fa862b89b24169fb78c4c95aeb07992c9cec" +checksum = "fb37d2df5df740e582f28f8560cf425f52bb267d872fe58358eadb554909f07a" dependencies = [ "unicode-xid", ] @@ -528,20 +576,20 @@ checksum = "1ad1d488a557b235fc46dae55512ffbfc429d2482b08b4d9435ab07384ca8aec" [[package]] name = "structopt" -version = "0.3.21" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5277acd7ee46e63e5168a80734c9f6ee81b1367a7d8772a2d765df2a3705d28c" +checksum = "40b9788f4202aa75c240ecc9c15c65185e6a39ccdeb0fd5d008b98825464c87c" dependencies = [ - "clap", + "clap 2.34.0", "lazy_static", "structopt-derive", ] [[package]] name = "structopt-derive" -version = "0.4.14" +version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ba9cdfda491b814720b6b06e0cac513d922fc407582032e8706e9f137976f90" +checksum = "dcb5ae327f9cc13b68763b5749770cb9e048a99bd9dfdfa58d0cf05d5f64afe0" dependencies = [ "heck", "proc-macro-error", @@ -552,9 +600,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.72" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1e8cdbefb79a9a5a65e0db8b47b723ee907b7c7f8496c76a1770b5c310bab82" +checksum = "8daf5dd0bb60cbd4137b1b587d2fc0ae729bc07cf01cd70b36a1ed5ade3b9d59" dependencies = [ "proc-macro2", "quote", @@ -606,6 +654,15 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "textwrap" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0066c8d12af8b5acd21e00547c3797fde4e8677254a7ee429176ccebbe93dd80" +dependencies = [ + "unicode-width", +] + [[package]] name = "toml" version = "0.5.8" @@ -615,6 +672,15 @@ dependencies = [ "serde", ] +[[package]] +name = "unicase" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" +dependencies = [ + "version_check", +] + [[package]] name = "unicode-segmentation" version = "1.7.1" diff --git a/Cargo.toml b/Cargo.toml index ef56775f..2df7734c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,6 +40,14 @@ version = "1.0" [dependencies.base32] version = "0.4.0" +[dependencies.clap] +version = "3.0.0-rc.0" +default-features = false +features = ["derive", "std", "unicode"] + +[dependencies.clap_generate] +version = "3.0.0-rc.0" + [dependencies.directories] version = "3" diff --git a/src/arg_util.rs b/src/arg_util.rs index 563cfd39..ee580187 100644 --- a/src/arg_util.rs +++ b/src/arg_util.rs @@ -23,7 +23,7 @@ macro_rules! Command { $( $(#[$doc:meta])* $var:ident$(($inner:ty))? => $exec:expr, ) * ] ) => { $(#[$docs])* - #[derive(Debug, PartialEq, structopt::StructOpt)] + #[derive(Debug, PartialEq, clap::StructOpt)] pub enum $name { $( $(#[$doc])* diff --git a/src/args.rs b/src/args.rs index 71ffbd64..8576098e 100644 --- a/src/args.rs +++ b/src/args.rs @@ -4,17 +4,17 @@ // SPDX-License-Identifier: GPL-3.0-or-later use std::convert; -use std::ffi; +use std::ffi::OsString; /// Provides access to a Nitrokey device -#[derive(Debug, structopt::StructOpt)] -#[structopt(name = "nitrocli", no_version)] +#[derive(Debug, clap::StructOpt)] +#[structopt(name = "nitrocli")] pub struct Args { /// Increases the log level (can be supplied multiple times) #[structopt(short, long, global = true, parse(from_occurrences))] pub verbose: u8, /// Selects the device model to connect to - #[structopt(short, long, global = true, possible_values = &DeviceModel::all_str())] + #[structopt(short, long, global = true, possible_values = DeviceModel::all_str())] pub model: Option, /// Sets the serial number of the device to connect to. Can be set /// multiple times to allow multiple serial numbers @@ -22,8 +22,7 @@ pub struct Args { #[structopt( long = "serial-number", global = true, - multiple = true, - number_of_values = 1 + multiple_occurrences = true, )] pub serial_numbers: Vec, /// Sets the USB path of the device to connect to @@ -110,11 +109,11 @@ Command! { Unencrypted(UnencryptedArgs) => |ctx, args: UnencryptedArgs| args.subcmd.execute(ctx), /// An extension and its arguments. #[structopt(external_subcommand)] - Extension(Vec) => crate::commands::extension, + Extension(Vec) => crate::commands::extension, ] } -#[derive(Debug, PartialEq, structopt::StructOpt)] +#[derive(Debug, PartialEq, clap::StructOpt)] pub struct ConfigArgs { #[structopt(subcommand)] subcmd: ConfigCommand, @@ -127,31 +126,31 @@ Command! {ConfigCommand, [ Set(ConfigSetArgs) => crate::commands::config_set, ]} -#[derive(Debug, PartialEq, structopt::StructOpt)] +#[derive(Debug, PartialEq, clap::StructOpt)] pub struct ConfigSetArgs { /// Sets the Num Lock option to the given HOTP slot - #[structopt(short = "n", long)] + #[structopt(short = 'n', long)] pub num_lock: Option, /// Unsets the Num Lock option - #[structopt(short = "N", long, conflicts_with("num-lock"))] + #[structopt(short = 'N', long, conflicts_with("num-lock"))] pub no_num_lock: bool, /// Sets the Cap Lock option to the given HOTP slot - #[structopt(short = "c", long)] + #[structopt(short = 'c', long)] pub caps_lock: Option, /// Unsets the Caps Lock option - #[structopt(short = "C", long, conflicts_with("caps-lock"))] + #[structopt(short = 'C', long, conflicts_with("caps-lock"))] pub no_caps_lock: bool, /// Sets the Scroll Lock option to the given HOTP slot - #[structopt(short = "s", long)] + #[structopt(short = 's', long)] pub scroll_lock: Option, /// Unsets the Scroll Lock option - #[structopt(short = "S", long, conflicts_with("scroll-lock"))] + #[structopt(short = 'S', long, conflicts_with("scroll-lock"))] pub no_scroll_lock: bool, /// Requires the user PIN to generate one-time passwords - #[structopt(short = "o", long)] + #[structopt(short = 'o', long)] pub otp_pin: bool, /// Allows one-time password generation without PIN - #[structopt(short = "O", long, conflicts_with("otp-pin"))] + #[structopt(short = 'O', long, conflicts_with("otp-pin"))] pub no_otp_pin: bool, } @@ -188,7 +187,7 @@ impl ConfigOption { } } -#[derive(Debug, PartialEq, structopt::StructOpt)] +#[derive(Debug, PartialEq, clap::StructOpt)] pub struct EncryptedArgs { #[structopt(subcommand)] subcmd: EncryptedCommand, @@ -201,7 +200,7 @@ Command! {EncryptedCommand, [ Open => crate::commands::encrypted_open, ]} -#[derive(Debug, PartialEq, structopt::StructOpt)] +#[derive(Debug, PartialEq, clap::StructOpt)] pub struct FillArgs { /// Checks if a fill operation is already running and show its progress instead of starting a new /// operation. @@ -209,7 +208,7 @@ pub struct FillArgs { attach: bool, } -#[derive(Debug, PartialEq, structopt::StructOpt)] +#[derive(Debug, PartialEq, clap::StructOpt)] pub struct HiddenArgs { #[structopt(subcommand)] subcmd: HiddenCommand, @@ -226,7 +225,7 @@ Command! {HiddenCommand, [ Open => crate::commands::hidden_open, ]} -#[derive(Debug, PartialEq, structopt::StructOpt)] +#[derive(Debug, PartialEq, clap::StructOpt)] pub struct HiddenCreateArgs { /// The hidden volume slot to use pub slot: u8, @@ -236,14 +235,14 @@ pub struct HiddenCreateArgs { pub end: u8, } -#[derive(Debug, PartialEq, structopt::StructOpt)] +#[derive(Debug, PartialEq, clap::StructOpt)] pub struct ListArgs { /// Only print the information that is available without connecting to a device #[structopt(short, long)] pub no_connect: bool, } -#[derive(Debug, PartialEq, structopt::StructOpt)] +#[derive(Debug, PartialEq, clap::StructOpt)] pub struct OtpArgs { #[structopt(subcommand)] subcmd: OtpCommand, @@ -264,21 +263,21 @@ Command! {OtpCommand, [ Status(OtpStatusArgs) => |ctx, args: OtpStatusArgs| crate::commands::otp_status(ctx, args.all), ]} -#[derive(Debug, PartialEq, structopt::StructOpt)] +#[derive(Debug, PartialEq, clap::StructOpt)] pub struct OtpClearArgs { /// The OTP algorithm to use #[structopt(short, long, default_value = OtpAlgorithm::Totp.as_ref(), - possible_values = &OtpAlgorithm::all_str())] + possible_values = OtpAlgorithm::all_str())] pub algorithm: OtpAlgorithm, /// The OTP slot to clear pub slot: u8, } -#[derive(Debug, PartialEq, structopt::StructOpt)] +#[derive(Debug, PartialEq, clap::StructOpt)] pub struct OtpGetArgs { /// The OTP algorithm to use #[structopt(short, long, default_value = OtpAlgorithm::Totp.as_ref(), - possible_values = &OtpAlgorithm::all_str())] + possible_values = OtpAlgorithm::all_str())] pub algorithm: OtpAlgorithm, /// The time to use for TOTP generation (Unix timestamp) [default: system time] #[structopt(short, long)] @@ -287,15 +286,15 @@ pub struct OtpGetArgs { pub slot: u8, } -#[derive(Debug, PartialEq, structopt::StructOpt)] +#[derive(Debug, PartialEq, clap::StructOpt)] pub struct OtpSetArgs { /// The OTP algorithm to use #[structopt(short, long, default_value = OtpAlgorithm::Totp.as_ref(), - possible_values = &OtpAlgorithm::all_str())] + possible_values = OtpAlgorithm::all_str())] pub algorithm: OtpAlgorithm, /// The number of digits to use for the one-time password #[structopt(short, long, default_value = OtpMode::SixDigits.as_ref(), - possible_values = &OtpMode::all_str())] + possible_values = OtpMode::all_str())] pub digits: OtpMode, /// The counter value for HOTP #[structopt(short, long, default_value = "0")] @@ -305,7 +304,7 @@ pub struct OtpSetArgs { pub time_window: u16, /// The format of the secret #[structopt(short, long, default_value = OtpSecretFormat::Base32.as_ref(), - possible_values = &OtpSecretFormat::all_str())] + possible_values = OtpSecretFormat::all_str())] pub format: OtpSecretFormat, /// The OTP slot to use pub slot: u8, @@ -316,7 +315,7 @@ pub struct OtpSetArgs { pub secret: String, } -#[derive(Debug, PartialEq, structopt::StructOpt)] +#[derive(Debug, PartialEq, clap::StructOpt)] pub struct OtpStatusArgs { /// Shows slots that are not programmed #[structopt(short, long)] @@ -348,7 +347,7 @@ Enum! {OtpSecretFormat, [ Hex => "hex", ]} -#[derive(Debug, PartialEq, structopt::StructOpt)] +#[derive(Debug, PartialEq, clap::StructOpt)] pub struct PinArgs { #[structopt(subcommand)] subcmd: PinCommand, @@ -374,14 +373,14 @@ Enum! { ] } -#[derive(Debug, PartialEq, structopt::StructOpt)] +#[derive(Debug, PartialEq, clap::StructOpt)] pub struct PinSetArgs { /// The PIN type to change - #[structopt(name = "type", possible_values = &PinType::all_str())] + #[structopt(name = "type", possible_values = PinType::all_str())] pub pintype: PinType, } -#[derive(Debug, PartialEq, structopt::StructOpt)] +#[derive(Debug, PartialEq, clap::StructOpt)] pub struct PwsArgs { #[structopt(subcommand)] subcmd: PwsCommand, @@ -412,13 +411,13 @@ Command! {PwsCommand, [ Status(PwsStatusArgs) => |ctx, args: PwsStatusArgs| crate::commands::pws_status(ctx, args.all), ]} -#[derive(Debug, PartialEq, structopt::StructOpt)] +#[derive(Debug, PartialEq, clap::StructOpt)] pub struct PwsClearArgs { /// The PWS slot to clear pub slot: u8, } -#[derive(Debug, PartialEq, structopt::StructOpt)] +#[derive(Debug, PartialEq, clap::StructOpt)] pub struct PwsGetArgs { /// Shows the name stored on the slot #[structopt(short, long)] @@ -436,7 +435,7 @@ pub struct PwsGetArgs { pub slot: u8, } -#[derive(Debug, PartialEq, structopt::StructOpt)] +#[derive(Debug, PartialEq, clap::StructOpt)] pub struct PwsAddArgs { /// The name to store on the slot pub name: String, @@ -451,7 +450,7 @@ pub struct PwsAddArgs { pub slot: Option, } -#[derive(Debug, PartialEq, structopt::StructOpt)] +#[derive(Debug, PartialEq, clap::StructOpt)] pub struct PwsUpdateArgs { /// The PWS slot to update pub slot: u8, @@ -466,21 +465,21 @@ pub struct PwsUpdateArgs { pub password: Option, } -#[derive(Debug, PartialEq, structopt::StructOpt)] +#[derive(Debug, PartialEq, clap::StructOpt)] pub struct PwsStatusArgs { /// Shows slots that are not programmed #[structopt(short, long)] pub all: bool, } -#[derive(Debug, PartialEq, structopt::StructOpt)] +#[derive(Debug, PartialEq, clap::StructOpt)] pub struct ResetArgs { /// Only build a new AES key instead of performing a full factory reset. #[structopt(long)] pub only_aes_key: bool, } -#[derive(Debug, PartialEq, structopt::StructOpt)] +#[derive(Debug, PartialEq, clap::StructOpt)] pub struct UnencryptedArgs { #[structopt(subcommand)] subcmd: UnencryptedCommand, @@ -493,10 +492,10 @@ Command! {UnencryptedCommand, [ }, ]} -#[derive(Debug, PartialEq, structopt::StructOpt)] +#[derive(Debug, PartialEq, clap::StructOpt)] pub struct UnencryptedSetArgs { /// The mode to change to - #[structopt(name = "type", possible_values = &UnencryptedVolumeMode::all_str())] + #[structopt(name = "type", possible_values = UnencryptedVolumeMode::all_str())] pub mode: UnencryptedVolumeMode, } diff --git a/src/main.rs b/src/main.rs index 882d7d5b..dc11617e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -69,9 +69,9 @@ use std::io; use std::process; use std::str; -use structopt::clap::ErrorKind; -use structopt::clap::SubCommand; -use structopt::StructOpt; +use clap::ErrorKind; +use clap::FromArgMatches; +use clap::IntoApp; const NITROCLI_BINARY: &str = "NITROCLI_BINARY"; const NITROCLI_RESOLVED_USB_PATH: &str = "NITROCLI_RESOLVED_USB_PATH"; @@ -112,15 +112,16 @@ impl error::Error for DirectExitError {} /// Parse the command-line arguments and execute the selected command. fn handle_arguments(ctx: &mut Context<'_>, argv: Vec) -> anyhow::Result<()> { let version = get_version_string(); - let clap = args::Args::clap().version(version.as_str()); - match clap.get_matches_from_safe(argv.iter()) { - Ok(matches) => { - let args = args::Args::from_clap(&matches); + let clap = args::Args::into_app().version(version.as_str()); + let matches = clap.try_get_matches_from(argv.iter()); + let args = matches.and_then(|matches| args::Args::from_arg_matches(&matches)); + match args { + Ok(args) => { ctx.config.update(&args); args.cmd.execute(ctx) } Err(mut err) => { - if err.kind == ErrorKind::HelpDisplayed { + if err.kind == ErrorKind::DisplayHelp { // For the convenience of the user we'd like to list the // available extensions in the help text. At the same time, we // don't want to unconditionally iterate through PATH (which may @@ -129,14 +130,14 @@ fn handle_arguments(ctx: &mut Context<'_>, argv: Vec) -> anyhow::Result< // help text is actually displayed. let path = ctx.path.clone().unwrap_or_else(ffi::OsString::new); if let Ok(extensions) = commands::discover_extensions(&path) { - let mut clap = args::Args::clap(); + let mut clap = args::Args::into_app(); for name in extensions { // Because of clap's brain dead API, we see no other way // but to leak the string we created here. That's okay, // though, because we exit in a moment anyway. let about = Box::leak(format!("Run the {} extension", name).into_boxed_str()); clap = clap.subcommand( - SubCommand::with_name(&name) + clap::App::new(name) // Use some magic number here that causes all // extensions to be listed after all other // subcommands. @@ -147,14 +148,15 @@ fn handle_arguments(ctx: &mut Context<'_>, argv: Vec) -> anyhow::Result< // At this point we are *pretty* sure that repeated invocation // will result in another error. So should be fine to unwrap // here. - err = clap.get_matches_from_safe(argv.iter()).unwrap_err(); + err = clap.try_get_matches_from(argv.iter()).unwrap_err(); } } if err.use_stderr() { Err(err.into()) } else { - println!(ctx, "{}", err.message)?; + // TODO: check + println!(ctx, "{}", err)?; Ok(()) } } diff --git a/src/tests/snapshots/nitrocli__tests__run__nitrocli_--help.snap b/src/tests/snapshots/nitrocli__tests__run__nitrocli_--help.snap index 65e6e65e..0c93c37e 100644 --- a/src/tests/snapshots/nitrocli__tests__run__nitrocli_--help.snap +++ b/src/tests/snapshots/nitrocli__tests__run__nitrocli_--help.snap @@ -3,30 +3,38 @@ source: src/tests/run.rs expression: s --- -nitrocli 0.4.1 -A top-level command for nitrocli +nitrocli -USAGE: - nitrocli [FLAGS] [OPTIONS] +Provides access to a Nitrokey device -FLAGS: - -h, --help Prints help information - --no-cache Disables the cache for all secrets - -V, --version Prints version information - -v, --verbose Increases the log level (can be supplied multiple times) +USAGE: + nitrocli [OPTIONS] OPTIONS: - -m, --model Selects the device model to connect to [possible values: librem, pro, - storage] - --serial-number ... Sets the serial number of the device to connect to. Can be set multiple - times to allow multiple serial numbers - --usb-path Sets the USB path of the device to connect to + -h, --help + Print help information + + -m, --model + Selects the device model to connect to [possible values: librem, pro, storage] + + --no-cache + Disables the cache for all secrets + + --serial-number + Sets the serial number of the device to connect to. Can be set multiple times to allow + multiple serial numbers + + --usb-path + Sets the USB path of the device to connect to + + -v, --verbose + Increases the log level (can be supplied multiple times) SUBCOMMANDS: config Reads or writes the device configuration encrypted Interacts with the device's encrypted volume fill Fills the SD card with random data - help Prints this message or the help of the given subcommand(s) + help Print this message or the help of the given subcommand(s) hidden Interacts with the device's hidden volume list Lists the attached Nitrokey devices lock Locks the connected Nitrokey device @@ -37,3 +45,4 @@ SUBCOMMANDS: status Prints the status of the connected Nitrokey device unencrypted Interacts with the device's unencrypted volume + diff --git a/src/tests/snapshots/nitrocli__tests__run__nitrocli_-h.snap b/src/tests/snapshots/nitrocli__tests__run__nitrocli_-h.snap index 65e6e65e..0c93c37e 100644 --- a/src/tests/snapshots/nitrocli__tests__run__nitrocli_-h.snap +++ b/src/tests/snapshots/nitrocli__tests__run__nitrocli_-h.snap @@ -3,30 +3,38 @@ source: src/tests/run.rs expression: s --- -nitrocli 0.4.1 -A top-level command for nitrocli +nitrocli -USAGE: - nitrocli [FLAGS] [OPTIONS] +Provides access to a Nitrokey device -FLAGS: - -h, --help Prints help information - --no-cache Disables the cache for all secrets - -V, --version Prints version information - -v, --verbose Increases the log level (can be supplied multiple times) +USAGE: + nitrocli [OPTIONS] OPTIONS: - -m, --model Selects the device model to connect to [possible values: librem, pro, - storage] - --serial-number ... Sets the serial number of the device to connect to. Can be set multiple - times to allow multiple serial numbers - --usb-path Sets the USB path of the device to connect to + -h, --help + Print help information + + -m, --model + Selects the device model to connect to [possible values: librem, pro, storage] + + --no-cache + Disables the cache for all secrets + + --serial-number + Sets the serial number of the device to connect to. Can be set multiple times to allow + multiple serial numbers + + --usb-path + Sets the USB path of the device to connect to + + -v, --verbose + Increases the log level (can be supplied multiple times) SUBCOMMANDS: config Reads or writes the device configuration encrypted Interacts with the device's encrypted volume fill Fills the SD card with random data - help Prints this message or the help of the given subcommand(s) + help Print this message or the help of the given subcommand(s) hidden Interacts with the device's hidden volume list Lists the attached Nitrokey devices lock Locks the connected Nitrokey device @@ -37,3 +45,4 @@ SUBCOMMANDS: status Prints the status of the connected Nitrokey device unencrypted Interacts with the device's unencrypted volume + diff --git a/src/tests/snapshots/nitrocli__tests__run__nitrocli_config_--help.snap b/src/tests/snapshots/nitrocli__tests__run__nitrocli_config_--help.snap index f9be9fec..5cfa6c84 100644 --- a/src/tests/snapshots/nitrocli__tests__run__nitrocli_config_--help.snap +++ b/src/tests/snapshots/nitrocli__tests__run__nitrocli_config_--help.snap @@ -3,27 +3,36 @@ source: src/tests/run.rs expression: s --- -nitrocli-config 0.4.1 +nitrocli-config + Reads or writes the device configuration USAGE: - nitrocli config [FLAGS] [OPTIONS] - -FLAGS: - -h, --help Prints help information - --no-cache Disables the cache for all secrets - -V, --version Prints version information - -v, --verbose Increases the log level (can be supplied multiple times) + nitrocli config [OPTIONS] OPTIONS: - -m, --model Selects the device model to connect to [possible values: librem, pro, - storage] - --serial-number ... Sets the serial number of the device to connect to. Can be set multiple - times to allow multiple serial numbers - --usb-path Sets the USB path of the device to connect to + -h, --help + Print help information + + -m, --model + Selects the device model to connect to [possible values: librem, pro, storage] + + --no-cache + Disables the cache for all secrets + + --serial-number + Sets the serial number of the device to connect to. Can be set multiple times to allow + multiple serial numbers + + --usb-path + Sets the USB path of the device to connect to + + -v, --verbose + Increases the log level (can be supplied multiple times) SUBCOMMANDS: get Prints the Nitrokey configuration - help Prints this message or the help of the given subcommand(s) + help Print this message or the help of the given subcommand(s) set Changes the Nitrokey configuration + diff --git a/src/tests/snapshots/nitrocli__tests__run__nitrocli_config_-h.snap b/src/tests/snapshots/nitrocli__tests__run__nitrocli_config_-h.snap index f9be9fec..5cfa6c84 100644 --- a/src/tests/snapshots/nitrocli__tests__run__nitrocli_config_-h.snap +++ b/src/tests/snapshots/nitrocli__tests__run__nitrocli_config_-h.snap @@ -3,27 +3,36 @@ source: src/tests/run.rs expression: s --- -nitrocli-config 0.4.1 +nitrocli-config + Reads or writes the device configuration USAGE: - nitrocli config [FLAGS] [OPTIONS] - -FLAGS: - -h, --help Prints help information - --no-cache Disables the cache for all secrets - -V, --version Prints version information - -v, --verbose Increases the log level (can be supplied multiple times) + nitrocli config [OPTIONS] OPTIONS: - -m, --model Selects the device model to connect to [possible values: librem, pro, - storage] - --serial-number ... Sets the serial number of the device to connect to. Can be set multiple - times to allow multiple serial numbers - --usb-path Sets the USB path of the device to connect to + -h, --help + Print help information + + -m, --model + Selects the device model to connect to [possible values: librem, pro, storage] + + --no-cache + Disables the cache for all secrets + + --serial-number + Sets the serial number of the device to connect to. Can be set multiple times to allow + multiple serial numbers + + --usb-path + Sets the USB path of the device to connect to + + -v, --verbose + Increases the log level (can be supplied multiple times) SUBCOMMANDS: get Prints the Nitrokey configuration - help Prints this message or the help of the given subcommand(s) + help Print this message or the help of the given subcommand(s) set Changes the Nitrokey configuration + diff --git a/src/tests/snapshots/nitrocli__tests__run__nitrocli_config_get_--help.snap b/src/tests/snapshots/nitrocli__tests__run__nitrocli_config_get_--help.snap index 6a7d1820..1943c02a 100644 --- a/src/tests/snapshots/nitrocli__tests__run__nitrocli_config_get_--help.snap +++ b/src/tests/snapshots/nitrocli__tests__run__nitrocli_config_get_--help.snap @@ -3,22 +3,31 @@ source: src/tests/run.rs expression: s --- -nitrocli-config-get 0.4.1 +nitrocli-config-get + Prints the Nitrokey configuration USAGE: - nitrocli config get [FLAGS] [OPTIONS] - -FLAGS: - -h, --help Prints help information - --no-cache Disables the cache for all secrets - -V, --version Prints version information - -v, --verbose Increases the log level (can be supplied multiple times) + nitrocli config get [OPTIONS] OPTIONS: - -m, --model Selects the device model to connect to [possible values: librem, pro, - storage] - --serial-number ... Sets the serial number of the device to connect to. Can be set multiple - times to allow multiple serial numbers - --usb-path Sets the USB path of the device to connect to + -h, --help + Print help information + + -m, --model + Selects the device model to connect to [possible values: librem, pro, storage] + + --no-cache + Disables the cache for all secrets + + --serial-number + Sets the serial number of the device to connect to. Can be set multiple times to allow + multiple serial numbers + + --usb-path + Sets the USB path of the device to connect to + + -v, --verbose + Increases the log level (can be supplied multiple times) + diff --git a/src/tests/snapshots/nitrocli__tests__run__nitrocli_config_get_-h.snap b/src/tests/snapshots/nitrocli__tests__run__nitrocli_config_get_-h.snap index 6a7d1820..1943c02a 100644 --- a/src/tests/snapshots/nitrocli__tests__run__nitrocli_config_get_-h.snap +++ b/src/tests/snapshots/nitrocli__tests__run__nitrocli_config_get_-h.snap @@ -3,22 +3,31 @@ source: src/tests/run.rs expression: s --- -nitrocli-config-get 0.4.1 +nitrocli-config-get + Prints the Nitrokey configuration USAGE: - nitrocli config get [FLAGS] [OPTIONS] - -FLAGS: - -h, --help Prints help information - --no-cache Disables the cache for all secrets - -V, --version Prints version information - -v, --verbose Increases the log level (can be supplied multiple times) + nitrocli config get [OPTIONS] OPTIONS: - -m, --model Selects the device model to connect to [possible values: librem, pro, - storage] - --serial-number ... Sets the serial number of the device to connect to. Can be set multiple - times to allow multiple serial numbers - --usb-path Sets the USB path of the device to connect to + -h, --help + Print help information + + -m, --model + Selects the device model to connect to [possible values: librem, pro, storage] + + --no-cache + Disables the cache for all secrets + + --serial-number + Sets the serial number of the device to connect to. Can be set multiple times to allow + multiple serial numbers + + --usb-path + Sets the USB path of the device to connect to + + -v, --verbose + Increases the log level (can be supplied multiple times) + diff --git a/src/tests/snapshots/nitrocli__tests__run__nitrocli_config_set_--help.snap b/src/tests/snapshots/nitrocli__tests__run__nitrocli_config_set_--help.snap index 0f73e2d4..815484c6 100644 --- a/src/tests/snapshots/nitrocli__tests__run__nitrocli_config_set_--help.snap +++ b/src/tests/snapshots/nitrocli__tests__run__nitrocli_config_set_--help.snap @@ -3,30 +3,55 @@ source: src/tests/run.rs expression: s --- -nitrocli-config-set 0.4.1 +nitrocli-config-set + Changes the Nitrokey configuration USAGE: - nitrocli config set [FLAGS] [OPTIONS] - -FLAGS: - -h, --help Prints help information - --no-cache Disables the cache for all secrets - -C, --no-caps-lock Unsets the Caps Lock option - -N, --no-num-lock Unsets the Num Lock option - -O, --no-otp-pin Allows one-time password generation without PIN - -S, --no-scroll-lock Unsets the Scroll Lock option - -o, --otp-pin Requires the user PIN to generate one-time passwords - -V, --version Prints version information - -v, --verbose Increases the log level (can be supplied multiple times) + nitrocli config set [OPTIONS] OPTIONS: - -c, --caps-lock Sets the Cap Lock option to the given HOTP slot - -m, --model Selects the device model to connect to [possible values: librem, pro, - storage] - -n, --num-lock Sets the Num Lock option to the given HOTP slot - -s, --scroll-lock Sets the Scroll Lock option to the given HOTP slot - --serial-number ... Sets the serial number of the device to connect to. Can be set multiple - times to allow multiple serial numbers - --usb-path Sets the USB path of the device to connect to + -c, --caps-lock + Sets the Cap Lock option to the given HOTP slot + + -C, --no-caps-lock + Unsets the Caps Lock option + + -h, --help + Print help information + + -m, --model + Selects the device model to connect to [possible values: librem, pro, storage] + + -n, --num-lock + Sets the Num Lock option to the given HOTP slot + + -N, --no-num-lock + Unsets the Num Lock option + + --no-cache + Disables the cache for all secrets + + -o, --otp-pin + Requires the user PIN to generate one-time passwords + + -O, --no-otp-pin + Allows one-time password generation without PIN + + -s, --scroll-lock + Sets the Scroll Lock option to the given HOTP slot + + -S, --no-scroll-lock + Unsets the Scroll Lock option + + --serial-number + Sets the serial number of the device to connect to. Can be set multiple times to allow + multiple serial numbers + + --usb-path + Sets the USB path of the device to connect to + + -v, --verbose + Increases the log level (can be supplied multiple times) + diff --git a/src/tests/snapshots/nitrocli__tests__run__nitrocli_config_set_-h.snap b/src/tests/snapshots/nitrocli__tests__run__nitrocli_config_set_-h.snap index 0f73e2d4..815484c6 100644 --- a/src/tests/snapshots/nitrocli__tests__run__nitrocli_config_set_-h.snap +++ b/src/tests/snapshots/nitrocli__tests__run__nitrocli_config_set_-h.snap @@ -3,30 +3,55 @@ source: src/tests/run.rs expression: s --- -nitrocli-config-set 0.4.1 +nitrocli-config-set + Changes the Nitrokey configuration USAGE: - nitrocli config set [FLAGS] [OPTIONS] - -FLAGS: - -h, --help Prints help information - --no-cache Disables the cache for all secrets - -C, --no-caps-lock Unsets the Caps Lock option - -N, --no-num-lock Unsets the Num Lock option - -O, --no-otp-pin Allows one-time password generation without PIN - -S, --no-scroll-lock Unsets the Scroll Lock option - -o, --otp-pin Requires the user PIN to generate one-time passwords - -V, --version Prints version information - -v, --verbose Increases the log level (can be supplied multiple times) + nitrocli config set [OPTIONS] OPTIONS: - -c, --caps-lock Sets the Cap Lock option to the given HOTP slot - -m, --model Selects the device model to connect to [possible values: librem, pro, - storage] - -n, --num-lock Sets the Num Lock option to the given HOTP slot - -s, --scroll-lock Sets the Scroll Lock option to the given HOTP slot - --serial-number ... Sets the serial number of the device to connect to. Can be set multiple - times to allow multiple serial numbers - --usb-path Sets the USB path of the device to connect to + -c, --caps-lock + Sets the Cap Lock option to the given HOTP slot + + -C, --no-caps-lock + Unsets the Caps Lock option + + -h, --help + Print help information + + -m, --model + Selects the device model to connect to [possible values: librem, pro, storage] + + -n, --num-lock + Sets the Num Lock option to the given HOTP slot + + -N, --no-num-lock + Unsets the Num Lock option + + --no-cache + Disables the cache for all secrets + + -o, --otp-pin + Requires the user PIN to generate one-time passwords + + -O, --no-otp-pin + Allows one-time password generation without PIN + + -s, --scroll-lock + Sets the Scroll Lock option to the given HOTP slot + + -S, --no-scroll-lock + Unsets the Scroll Lock option + + --serial-number + Sets the serial number of the device to connect to. Can be set multiple times to allow + multiple serial numbers + + --usb-path + Sets the USB path of the device to connect to + + -v, --verbose + Increases the log level (can be supplied multiple times) + diff --git a/src/tests/snapshots/nitrocli__tests__run__nitrocli_encrypted_--help.snap b/src/tests/snapshots/nitrocli__tests__run__nitrocli_encrypted_--help.snap index e0b63529..2a53a686 100644 --- a/src/tests/snapshots/nitrocli__tests__run__nitrocli_encrypted_--help.snap +++ b/src/tests/snapshots/nitrocli__tests__run__nitrocli_encrypted_--help.snap @@ -3,27 +3,36 @@ source: src/tests/run.rs expression: s --- -nitrocli-encrypted 0.4.1 +nitrocli-encrypted + Interacts with the device's encrypted volume USAGE: - nitrocli encrypted [FLAGS] [OPTIONS] - -FLAGS: - -h, --help Prints help information - --no-cache Disables the cache for all secrets - -V, --version Prints version information - -v, --verbose Increases the log level (can be supplied multiple times) + nitrocli encrypted [OPTIONS] OPTIONS: - -m, --model Selects the device model to connect to [possible values: librem, pro, - storage] - --serial-number ... Sets the serial number of the device to connect to. Can be set multiple - times to allow multiple serial numbers - --usb-path Sets the USB path of the device to connect to + -h, --help + Print help information + + -m, --model + Selects the device model to connect to [possible values: librem, pro, storage] + + --no-cache + Disables the cache for all secrets + + --serial-number + Sets the serial number of the device to connect to. Can be set multiple times to allow + multiple serial numbers + + --usb-path + Sets the USB path of the device to connect to + + -v, --verbose + Increases the log level (can be supplied multiple times) SUBCOMMANDS: close Closes the encrypted volume on a Nitrokey Storage - help Prints this message or the help of the given subcommand(s) + help Print this message or the help of the given subcommand(s) open Opens the encrypted volume on a Nitrokey Storage + diff --git a/src/tests/snapshots/nitrocli__tests__run__nitrocli_encrypted_-h.snap b/src/tests/snapshots/nitrocli__tests__run__nitrocli_encrypted_-h.snap index e0b63529..2a53a686 100644 --- a/src/tests/snapshots/nitrocli__tests__run__nitrocli_encrypted_-h.snap +++ b/src/tests/snapshots/nitrocli__tests__run__nitrocli_encrypted_-h.snap @@ -3,27 +3,36 @@ source: src/tests/run.rs expression: s --- -nitrocli-encrypted 0.4.1 +nitrocli-encrypted + Interacts with the device's encrypted volume USAGE: - nitrocli encrypted [FLAGS] [OPTIONS] - -FLAGS: - -h, --help Prints help information - --no-cache Disables the cache for all secrets - -V, --version Prints version information - -v, --verbose Increases the log level (can be supplied multiple times) + nitrocli encrypted [OPTIONS] OPTIONS: - -m, --model Selects the device model to connect to [possible values: librem, pro, - storage] - --serial-number ... Sets the serial number of the device to connect to. Can be set multiple - times to allow multiple serial numbers - --usb-path Sets the USB path of the device to connect to + -h, --help + Print help information + + -m, --model + Selects the device model to connect to [possible values: librem, pro, storage] + + --no-cache + Disables the cache for all secrets + + --serial-number + Sets the serial number of the device to connect to. Can be set multiple times to allow + multiple serial numbers + + --usb-path + Sets the USB path of the device to connect to + + -v, --verbose + Increases the log level (can be supplied multiple times) SUBCOMMANDS: close Closes the encrypted volume on a Nitrokey Storage - help Prints this message or the help of the given subcommand(s) + help Print this message or the help of the given subcommand(s) open Opens the encrypted volume on a Nitrokey Storage + diff --git a/src/tests/snapshots/nitrocli__tests__run__nitrocli_encrypted_close_--help.snap b/src/tests/snapshots/nitrocli__tests__run__nitrocli_encrypted_close_--help.snap index ffa4e339..8f3e68e2 100644 --- a/src/tests/snapshots/nitrocli__tests__run__nitrocli_encrypted_close_--help.snap +++ b/src/tests/snapshots/nitrocli__tests__run__nitrocli_encrypted_close_--help.snap @@ -3,22 +3,31 @@ source: src/tests/run.rs expression: s --- -nitrocli-encrypted-close 0.4.1 +nitrocli-encrypted-close + Closes the encrypted volume on a Nitrokey Storage USAGE: - nitrocli encrypted close [FLAGS] [OPTIONS] - -FLAGS: - -h, --help Prints help information - --no-cache Disables the cache for all secrets - -V, --version Prints version information - -v, --verbose Increases the log level (can be supplied multiple times) + nitrocli encrypted close [OPTIONS] OPTIONS: - -m, --model Selects the device model to connect to [possible values: librem, pro, - storage] - --serial-number ... Sets the serial number of the device to connect to. Can be set multiple - times to allow multiple serial numbers - --usb-path Sets the USB path of the device to connect to + -h, --help + Print help information + + -m, --model + Selects the device model to connect to [possible values: librem, pro, storage] + + --no-cache + Disables the cache for all secrets + + --serial-number + Sets the serial number of the device to connect to. Can be set multiple times to allow + multiple serial numbers + + --usb-path + Sets the USB path of the device to connect to + + -v, --verbose + Increases the log level (can be supplied multiple times) + diff --git a/src/tests/snapshots/nitrocli__tests__run__nitrocli_encrypted_close_-h.snap b/src/tests/snapshots/nitrocli__tests__run__nitrocli_encrypted_close_-h.snap index ffa4e339..8f3e68e2 100644 --- a/src/tests/snapshots/nitrocli__tests__run__nitrocli_encrypted_close_-h.snap +++ b/src/tests/snapshots/nitrocli__tests__run__nitrocli_encrypted_close_-h.snap @@ -3,22 +3,31 @@ source: src/tests/run.rs expression: s --- -nitrocli-encrypted-close 0.4.1 +nitrocli-encrypted-close + Closes the encrypted volume on a Nitrokey Storage USAGE: - nitrocli encrypted close [FLAGS] [OPTIONS] - -FLAGS: - -h, --help Prints help information - --no-cache Disables the cache for all secrets - -V, --version Prints version information - -v, --verbose Increases the log level (can be supplied multiple times) + nitrocli encrypted close [OPTIONS] OPTIONS: - -m, --model Selects the device model to connect to [possible values: librem, pro, - storage] - --serial-number ... Sets the serial number of the device to connect to. Can be set multiple - times to allow multiple serial numbers - --usb-path Sets the USB path of the device to connect to + -h, --help + Print help information + + -m, --model + Selects the device model to connect to [possible values: librem, pro, storage] + + --no-cache + Disables the cache for all secrets + + --serial-number + Sets the serial number of the device to connect to. Can be set multiple times to allow + multiple serial numbers + + --usb-path + Sets the USB path of the device to connect to + + -v, --verbose + Increases the log level (can be supplied multiple times) + diff --git a/src/tests/snapshots/nitrocli__tests__run__nitrocli_encrypted_open_--help.snap b/src/tests/snapshots/nitrocli__tests__run__nitrocli_encrypted_open_--help.snap index 34654ec1..efcfc3c9 100644 --- a/src/tests/snapshots/nitrocli__tests__run__nitrocli_encrypted_open_--help.snap +++ b/src/tests/snapshots/nitrocli__tests__run__nitrocli_encrypted_open_--help.snap @@ -3,22 +3,31 @@ source: src/tests/run.rs expression: s --- -nitrocli-encrypted-open 0.4.1 +nitrocli-encrypted-open + Opens the encrypted volume on a Nitrokey Storage USAGE: - nitrocli encrypted open [FLAGS] [OPTIONS] - -FLAGS: - -h, --help Prints help information - --no-cache Disables the cache for all secrets - -V, --version Prints version information - -v, --verbose Increases the log level (can be supplied multiple times) + nitrocli encrypted open [OPTIONS] OPTIONS: - -m, --model Selects the device model to connect to [possible values: librem, pro, - storage] - --serial-number ... Sets the serial number of the device to connect to. Can be set multiple - times to allow multiple serial numbers - --usb-path Sets the USB path of the device to connect to + -h, --help + Print help information + + -m, --model + Selects the device model to connect to [possible values: librem, pro, storage] + + --no-cache + Disables the cache for all secrets + + --serial-number + Sets the serial number of the device to connect to. Can be set multiple times to allow + multiple serial numbers + + --usb-path + Sets the USB path of the device to connect to + + -v, --verbose + Increases the log level (can be supplied multiple times) + diff --git a/src/tests/snapshots/nitrocli__tests__run__nitrocli_encrypted_open_-h.snap b/src/tests/snapshots/nitrocli__tests__run__nitrocli_encrypted_open_-h.snap index 34654ec1..efcfc3c9 100644 --- a/src/tests/snapshots/nitrocli__tests__run__nitrocli_encrypted_open_-h.snap +++ b/src/tests/snapshots/nitrocli__tests__run__nitrocli_encrypted_open_-h.snap @@ -3,22 +3,31 @@ source: src/tests/run.rs expression: s --- -nitrocli-encrypted-open 0.4.1 +nitrocli-encrypted-open + Opens the encrypted volume on a Nitrokey Storage USAGE: - nitrocli encrypted open [FLAGS] [OPTIONS] - -FLAGS: - -h, --help Prints help information - --no-cache Disables the cache for all secrets - -V, --version Prints version information - -v, --verbose Increases the log level (can be supplied multiple times) + nitrocli encrypted open [OPTIONS] OPTIONS: - -m, --model Selects the device model to connect to [possible values: librem, pro, - storage] - --serial-number ... Sets the serial number of the device to connect to. Can be set multiple - times to allow multiple serial numbers - --usb-path Sets the USB path of the device to connect to + -h, --help + Print help information + + -m, --model + Selects the device model to connect to [possible values: librem, pro, storage] + + --no-cache + Disables the cache for all secrets + + --serial-number + Sets the serial number of the device to connect to. Can be set multiple times to allow + multiple serial numbers + + --usb-path + Sets the USB path of the device to connect to + + -v, --verbose + Increases the log level (can be supplied multiple times) + diff --git a/src/tests/snapshots/nitrocli__tests__run__nitrocli_hidden_--help.snap b/src/tests/snapshots/nitrocli__tests__run__nitrocli_hidden_--help.snap index ff15a7ae..e34292f0 100644 --- a/src/tests/snapshots/nitrocli__tests__run__nitrocli_hidden_--help.snap +++ b/src/tests/snapshots/nitrocli__tests__run__nitrocli_hidden_--help.snap @@ -3,28 +3,37 @@ source: src/tests/run.rs expression: s --- -nitrocli-hidden 0.4.1 +nitrocli-hidden + Interacts with the device's hidden volume USAGE: - nitrocli hidden [FLAGS] [OPTIONS] - -FLAGS: - -h, --help Prints help information - --no-cache Disables the cache for all secrets - -V, --version Prints version information - -v, --verbose Increases the log level (can be supplied multiple times) + nitrocli hidden [OPTIONS] OPTIONS: - -m, --model Selects the device model to connect to [possible values: librem, pro, - storage] - --serial-number ... Sets the serial number of the device to connect to. Can be set multiple - times to allow multiple serial numbers - --usb-path Sets the USB path of the device to connect to + -h, --help + Print help information + + -m, --model + Selects the device model to connect to [possible values: librem, pro, storage] + + --no-cache + Disables the cache for all secrets + + --serial-number + Sets the serial number of the device to connect to. Can be set multiple times to allow + multiple serial numbers + + --usb-path + Sets the USB path of the device to connect to + + -v, --verbose + Increases the log level (can be supplied multiple times) SUBCOMMANDS: close Closes the hidden volume on a Nitrokey Storage create Creates a hidden volume on a Nitrokey Storage - help Prints this message or the help of the given subcommand(s) + help Print this message or the help of the given subcommand(s) open Opens the hidden volume on a Nitrokey Storage + diff --git a/src/tests/snapshots/nitrocli__tests__run__nitrocli_hidden_-h.snap b/src/tests/snapshots/nitrocli__tests__run__nitrocli_hidden_-h.snap index ff15a7ae..e34292f0 100644 --- a/src/tests/snapshots/nitrocli__tests__run__nitrocli_hidden_-h.snap +++ b/src/tests/snapshots/nitrocli__tests__run__nitrocli_hidden_-h.snap @@ -3,28 +3,37 @@ source: src/tests/run.rs expression: s --- -nitrocli-hidden 0.4.1 +nitrocli-hidden + Interacts with the device's hidden volume USAGE: - nitrocli hidden [FLAGS] [OPTIONS] - -FLAGS: - -h, --help Prints help information - --no-cache Disables the cache for all secrets - -V, --version Prints version information - -v, --verbose Increases the log level (can be supplied multiple times) + nitrocli hidden [OPTIONS] OPTIONS: - -m, --model Selects the device model to connect to [possible values: librem, pro, - storage] - --serial-number ... Sets the serial number of the device to connect to. Can be set multiple - times to allow multiple serial numbers - --usb-path Sets the USB path of the device to connect to + -h, --help + Print help information + + -m, --model + Selects the device model to connect to [possible values: librem, pro, storage] + + --no-cache + Disables the cache for all secrets + + --serial-number + Sets the serial number of the device to connect to. Can be set multiple times to allow + multiple serial numbers + + --usb-path + Sets the USB path of the device to connect to + + -v, --verbose + Increases the log level (can be supplied multiple times) SUBCOMMANDS: close Closes the hidden volume on a Nitrokey Storage create Creates a hidden volume on a Nitrokey Storage - help Prints this message or the help of the given subcommand(s) + help Print this message or the help of the given subcommand(s) open Opens the hidden volume on a Nitrokey Storage + diff --git a/src/tests/snapshots/nitrocli__tests__run__nitrocli_hidden_close_--help.snap b/src/tests/snapshots/nitrocli__tests__run__nitrocli_hidden_close_--help.snap index dcee4ab0..ef87e148 100644 --- a/src/tests/snapshots/nitrocli__tests__run__nitrocli_hidden_close_--help.snap +++ b/src/tests/snapshots/nitrocli__tests__run__nitrocli_hidden_close_--help.snap @@ -3,22 +3,31 @@ source: src/tests/run.rs expression: s --- -nitrocli-hidden-close 0.4.1 +nitrocli-hidden-close + Closes the hidden volume on a Nitrokey Storage USAGE: - nitrocli hidden close [FLAGS] [OPTIONS] - -FLAGS: - -h, --help Prints help information - --no-cache Disables the cache for all secrets - -V, --version Prints version information - -v, --verbose Increases the log level (can be supplied multiple times) + nitrocli hidden close [OPTIONS] OPTIONS: - -m, --model Selects the device model to connect to [possible values: librem, pro, - storage] - --serial-number ... Sets the serial number of the device to connect to. Can be set multiple - times to allow multiple serial numbers - --usb-path Sets the USB path of the device to connect to + -h, --help + Print help information + + -m, --model + Selects the device model to connect to [possible values: librem, pro, storage] + + --no-cache + Disables the cache for all secrets + + --serial-number + Sets the serial number of the device to connect to. Can be set multiple times to allow + multiple serial numbers + + --usb-path + Sets the USB path of the device to connect to + + -v, --verbose + Increases the log level (can be supplied multiple times) + diff --git a/src/tests/snapshots/nitrocli__tests__run__nitrocli_hidden_close_-h.snap b/src/tests/snapshots/nitrocli__tests__run__nitrocli_hidden_close_-h.snap index dcee4ab0..ef87e148 100644 --- a/src/tests/snapshots/nitrocli__tests__run__nitrocli_hidden_close_-h.snap +++ b/src/tests/snapshots/nitrocli__tests__run__nitrocli_hidden_close_-h.snap @@ -3,22 +3,31 @@ source: src/tests/run.rs expression: s --- -nitrocli-hidden-close 0.4.1 +nitrocli-hidden-close + Closes the hidden volume on a Nitrokey Storage USAGE: - nitrocli hidden close [FLAGS] [OPTIONS] - -FLAGS: - -h, --help Prints help information - --no-cache Disables the cache for all secrets - -V, --version Prints version information - -v, --verbose Increases the log level (can be supplied multiple times) + nitrocli hidden close [OPTIONS] OPTIONS: - -m, --model Selects the device model to connect to [possible values: librem, pro, - storage] - --serial-number ... Sets the serial number of the device to connect to. Can be set multiple - times to allow multiple serial numbers - --usb-path Sets the USB path of the device to connect to + -h, --help + Print help information + + -m, --model + Selects the device model to connect to [possible values: librem, pro, storage] + + --no-cache + Disables the cache for all secrets + + --serial-number + Sets the serial number of the device to connect to. Can be set multiple times to allow + multiple serial numbers + + --usb-path + Sets the USB path of the device to connect to + + -v, --verbose + Increases the log level (can be supplied multiple times) + diff --git a/src/tests/snapshots/nitrocli__tests__run__nitrocli_hidden_create_--help.snap b/src/tests/snapshots/nitrocli__tests__run__nitrocli_hidden_create_--help.snap index 7f4382d0..948935dd 100644 --- a/src/tests/snapshots/nitrocli__tests__run__nitrocli_hidden_create_--help.snap +++ b/src/tests/snapshots/nitrocli__tests__run__nitrocli_hidden_create_--help.snap @@ -3,27 +3,38 @@ source: src/tests/run.rs expression: s --- -nitrocli-hidden-create 0.4.1 +nitrocli-hidden-create + Creates a hidden volume on a Nitrokey Storage USAGE: - nitrocli hidden create [FLAGS] [OPTIONS] + nitrocli hidden create [OPTIONS] -FLAGS: - -h, --help Prints help information - --no-cache Disables the cache for all secrets - -V, --version Prints version information - -v, --verbose Increases the log level (can be supplied multiple times) +ARGS: + The hidden volume slot to use + The start location of the hidden volume as a percentage of the encrypted volume's + size (0-99) + The end location of the hidden volume as a percentage of the encrypted volume's + size (1-100) OPTIONS: - -m, --model Selects the device model to connect to [possible values: librem, pro, - storage] - --serial-number ... Sets the serial number of the device to connect to. Can be set multiple - times to allow multiple serial numbers - --usb-path Sets the USB path of the device to connect to + -h, --help + Print help information + + -m, --model + Selects the device model to connect to [possible values: librem, pro, storage] + + --no-cache + Disables the cache for all secrets + + --serial-number + Sets the serial number of the device to connect to. Can be set multiple times to allow + multiple serial numbers + + --usb-path + Sets the USB path of the device to connect to + + -v, --verbose + Increases the log level (can be supplied multiple times) -ARGS: - The hidden volume slot to use - The start location of the hidden volume as a percentage of the encrypted volume's size (0-99) - The end location of the hidden volume as a percentage of the encrypted volume's size (1-100) diff --git a/src/tests/snapshots/nitrocli__tests__run__nitrocli_hidden_create_-h.snap b/src/tests/snapshots/nitrocli__tests__run__nitrocli_hidden_create_-h.snap index 7f4382d0..948935dd 100644 --- a/src/tests/snapshots/nitrocli__tests__run__nitrocli_hidden_create_-h.snap +++ b/src/tests/snapshots/nitrocli__tests__run__nitrocli_hidden_create_-h.snap @@ -3,27 +3,38 @@ source: src/tests/run.rs expression: s --- -nitrocli-hidden-create 0.4.1 +nitrocli-hidden-create + Creates a hidden volume on a Nitrokey Storage USAGE: - nitrocli hidden create [FLAGS] [OPTIONS] + nitrocli hidden create [OPTIONS] -FLAGS: - -h, --help Prints help information - --no-cache Disables the cache for all secrets - -V, --version Prints version information - -v, --verbose Increases the log level (can be supplied multiple times) +ARGS: + The hidden volume slot to use + The start location of the hidden volume as a percentage of the encrypted volume's + size (0-99) + The end location of the hidden volume as a percentage of the encrypted volume's + size (1-100) OPTIONS: - -m, --model Selects the device model to connect to [possible values: librem, pro, - storage] - --serial-number ... Sets the serial number of the device to connect to. Can be set multiple - times to allow multiple serial numbers - --usb-path Sets the USB path of the device to connect to + -h, --help + Print help information + + -m, --model + Selects the device model to connect to [possible values: librem, pro, storage] + + --no-cache + Disables the cache for all secrets + + --serial-number + Sets the serial number of the device to connect to. Can be set multiple times to allow + multiple serial numbers + + --usb-path + Sets the USB path of the device to connect to + + -v, --verbose + Increases the log level (can be supplied multiple times) -ARGS: - The hidden volume slot to use - The start location of the hidden volume as a percentage of the encrypted volume's size (0-99) - The end location of the hidden volume as a percentage of the encrypted volume's size (1-100) diff --git a/src/tests/snapshots/nitrocli__tests__run__nitrocli_hidden_open_--help.snap b/src/tests/snapshots/nitrocli__tests__run__nitrocli_hidden_open_--help.snap index a2566ed2..c5f5a73b 100644 --- a/src/tests/snapshots/nitrocli__tests__run__nitrocli_hidden_open_--help.snap +++ b/src/tests/snapshots/nitrocli__tests__run__nitrocli_hidden_open_--help.snap @@ -3,22 +3,31 @@ source: src/tests/run.rs expression: s --- -nitrocli-hidden-open 0.4.1 +nitrocli-hidden-open + Opens the hidden volume on a Nitrokey Storage USAGE: - nitrocli hidden open [FLAGS] [OPTIONS] - -FLAGS: - -h, --help Prints help information - --no-cache Disables the cache for all secrets - -V, --version Prints version information - -v, --verbose Increases the log level (can be supplied multiple times) + nitrocli hidden open [OPTIONS] OPTIONS: - -m, --model Selects the device model to connect to [possible values: librem, pro, - storage] - --serial-number ... Sets the serial number of the device to connect to. Can be set multiple - times to allow multiple serial numbers - --usb-path Sets the USB path of the device to connect to + -h, --help + Print help information + + -m, --model + Selects the device model to connect to [possible values: librem, pro, storage] + + --no-cache + Disables the cache for all secrets + + --serial-number + Sets the serial number of the device to connect to. Can be set multiple times to allow + multiple serial numbers + + --usb-path + Sets the USB path of the device to connect to + + -v, --verbose + Increases the log level (can be supplied multiple times) + diff --git a/src/tests/snapshots/nitrocli__tests__run__nitrocli_hidden_open_-h.snap b/src/tests/snapshots/nitrocli__tests__run__nitrocli_hidden_open_-h.snap index a2566ed2..c5f5a73b 100644 --- a/src/tests/snapshots/nitrocli__tests__run__nitrocli_hidden_open_-h.snap +++ b/src/tests/snapshots/nitrocli__tests__run__nitrocli_hidden_open_-h.snap @@ -3,22 +3,31 @@ source: src/tests/run.rs expression: s --- -nitrocli-hidden-open 0.4.1 +nitrocli-hidden-open + Opens the hidden volume on a Nitrokey Storage USAGE: - nitrocli hidden open [FLAGS] [OPTIONS] - -FLAGS: - -h, --help Prints help information - --no-cache Disables the cache for all secrets - -V, --version Prints version information - -v, --verbose Increases the log level (can be supplied multiple times) + nitrocli hidden open [OPTIONS] OPTIONS: - -m, --model Selects the device model to connect to [possible values: librem, pro, - storage] - --serial-number ... Sets the serial number of the device to connect to. Can be set multiple - times to allow multiple serial numbers - --usb-path Sets the USB path of the device to connect to + -h, --help + Print help information + + -m, --model + Selects the device model to connect to [possible values: librem, pro, storage] + + --no-cache + Disables the cache for all secrets + + --serial-number + Sets the serial number of the device to connect to. Can be set multiple times to allow + multiple serial numbers + + --usb-path + Sets the USB path of the device to connect to + + -v, --verbose + Increases the log level (can be supplied multiple times) + diff --git a/src/tests/snapshots/nitrocli__tests__run__nitrocli_lock_--help.snap b/src/tests/snapshots/nitrocli__tests__run__nitrocli_lock_--help.snap index c1e0b2e8..f598cc09 100644 --- a/src/tests/snapshots/nitrocli__tests__run__nitrocli_lock_--help.snap +++ b/src/tests/snapshots/nitrocli__tests__run__nitrocli_lock_--help.snap @@ -3,22 +3,31 @@ source: src/tests/run.rs expression: s --- -nitrocli-lock 0.4.1 +nitrocli-lock + Locks the connected Nitrokey device USAGE: - nitrocli lock [FLAGS] [OPTIONS] - -FLAGS: - -h, --help Prints help information - --no-cache Disables the cache for all secrets - -V, --version Prints version information - -v, --verbose Increases the log level (can be supplied multiple times) + nitrocli lock [OPTIONS] OPTIONS: - -m, --model Selects the device model to connect to [possible values: librem, pro, - storage] - --serial-number ... Sets the serial number of the device to connect to. Can be set multiple - times to allow multiple serial numbers - --usb-path Sets the USB path of the device to connect to + -h, --help + Print help information + + -m, --model + Selects the device model to connect to [possible values: librem, pro, storage] + + --no-cache + Disables the cache for all secrets + + --serial-number + Sets the serial number of the device to connect to. Can be set multiple times to allow + multiple serial numbers + + --usb-path + Sets the USB path of the device to connect to + + -v, --verbose + Increases the log level (can be supplied multiple times) + diff --git a/src/tests/snapshots/nitrocli__tests__run__nitrocli_lock_-h.snap b/src/tests/snapshots/nitrocli__tests__run__nitrocli_lock_-h.snap index c1e0b2e8..f598cc09 100644 --- a/src/tests/snapshots/nitrocli__tests__run__nitrocli_lock_-h.snap +++ b/src/tests/snapshots/nitrocli__tests__run__nitrocli_lock_-h.snap @@ -3,22 +3,31 @@ source: src/tests/run.rs expression: s --- -nitrocli-lock 0.4.1 +nitrocli-lock + Locks the connected Nitrokey device USAGE: - nitrocli lock [FLAGS] [OPTIONS] - -FLAGS: - -h, --help Prints help information - --no-cache Disables the cache for all secrets - -V, --version Prints version information - -v, --verbose Increases the log level (can be supplied multiple times) + nitrocli lock [OPTIONS] OPTIONS: - -m, --model Selects the device model to connect to [possible values: librem, pro, - storage] - --serial-number ... Sets the serial number of the device to connect to. Can be set multiple - times to allow multiple serial numbers - --usb-path Sets the USB path of the device to connect to + -h, --help + Print help information + + -m, --model + Selects the device model to connect to [possible values: librem, pro, storage] + + --no-cache + Disables the cache for all secrets + + --serial-number + Sets the serial number of the device to connect to. Can be set multiple times to allow + multiple serial numbers + + --usb-path + Sets the USB path of the device to connect to + + -v, --verbose + Increases the log level (can be supplied multiple times) + diff --git a/src/tests/snapshots/nitrocli__tests__run__nitrocli_otp_--help.snap b/src/tests/snapshots/nitrocli__tests__run__nitrocli_otp_--help.snap index 051a1d4b..a21dd932 100644 --- a/src/tests/snapshots/nitrocli__tests__run__nitrocli_otp_--help.snap +++ b/src/tests/snapshots/nitrocli__tests__run__nitrocli_otp_--help.snap @@ -3,29 +3,38 @@ source: src/tests/run.rs expression: s --- -nitrocli-otp 0.4.1 +nitrocli-otp + Accesses one-time passwords USAGE: - nitrocli otp [FLAGS] [OPTIONS] - -FLAGS: - -h, --help Prints help information - --no-cache Disables the cache for all secrets - -V, --version Prints version information - -v, --verbose Increases the log level (can be supplied multiple times) + nitrocli otp [OPTIONS] OPTIONS: - -m, --model Selects the device model to connect to [possible values: librem, pro, - storage] - --serial-number ... Sets the serial number of the device to connect to. Can be set multiple - times to allow multiple serial numbers - --usb-path Sets the USB path of the device to connect to + -h, --help + Print help information + + -m, --model + Selects the device model to connect to [possible values: librem, pro, storage] + + --no-cache + Disables the cache for all secrets + + --serial-number + Sets the serial number of the device to connect to. Can be set multiple times to allow + multiple serial numbers + + --usb-path + Sets the USB path of the device to connect to + + -v, --verbose + Increases the log level (can be supplied multiple times) SUBCOMMANDS: clear Clears a one-time password slot get Generates a one-time password - help Prints this message or the help of the given subcommand(s) + help Print this message or the help of the given subcommand(s) set Configures a one-time password slot status Prints the status of the one-time password slots + diff --git a/src/tests/snapshots/nitrocli__tests__run__nitrocli_otp_-h.snap b/src/tests/snapshots/nitrocli__tests__run__nitrocli_otp_-h.snap index 051a1d4b..a21dd932 100644 --- a/src/tests/snapshots/nitrocli__tests__run__nitrocli_otp_-h.snap +++ b/src/tests/snapshots/nitrocli__tests__run__nitrocli_otp_-h.snap @@ -3,29 +3,38 @@ source: src/tests/run.rs expression: s --- -nitrocli-otp 0.4.1 +nitrocli-otp + Accesses one-time passwords USAGE: - nitrocli otp [FLAGS] [OPTIONS] - -FLAGS: - -h, --help Prints help information - --no-cache Disables the cache for all secrets - -V, --version Prints version information - -v, --verbose Increases the log level (can be supplied multiple times) + nitrocli otp [OPTIONS] OPTIONS: - -m, --model Selects the device model to connect to [possible values: librem, pro, - storage] - --serial-number ... Sets the serial number of the device to connect to. Can be set multiple - times to allow multiple serial numbers - --usb-path Sets the USB path of the device to connect to + -h, --help + Print help information + + -m, --model + Selects the device model to connect to [possible values: librem, pro, storage] + + --no-cache + Disables the cache for all secrets + + --serial-number + Sets the serial number of the device to connect to. Can be set multiple times to allow + multiple serial numbers + + --usb-path + Sets the USB path of the device to connect to + + -v, --verbose + Increases the log level (can be supplied multiple times) SUBCOMMANDS: clear Clears a one-time password slot get Generates a one-time password - help Prints this message or the help of the given subcommand(s) + help Print this message or the help of the given subcommand(s) set Configures a one-time password slot status Prints the status of the one-time password slots + diff --git a/src/tests/snapshots/nitrocli__tests__run__nitrocli_otp_clear_--help.snap b/src/tests/snapshots/nitrocli__tests__run__nitrocli_otp_clear_--help.snap index f6bde61c..40a0800b 100644 --- a/src/tests/snapshots/nitrocli__tests__run__nitrocli_otp_clear_--help.snap +++ b/src/tests/snapshots/nitrocli__tests__run__nitrocli_otp_clear_--help.snap @@ -3,26 +3,37 @@ source: src/tests/run.rs expression: s --- -nitrocli-otp-clear 0.4.1 +nitrocli-otp-clear + Clears a one-time password slot USAGE: - nitrocli otp clear [FLAGS] [OPTIONS] + nitrocli otp clear [OPTIONS] -FLAGS: - -h, --help Prints help information - --no-cache Disables the cache for all secrets - -V, --version Prints version information - -v, --verbose Increases the log level (can be supplied multiple times) +ARGS: + The OTP slot to clear OPTIONS: - -a, --algorithm The OTP algorithm to use [default: totp] [possible values: hotp, totp] - -m, --model Selects the device model to connect to [possible values: librem, pro, - storage] - --serial-number ... Sets the serial number of the device to connect to. Can be set multiple - times to allow multiple serial numbers - --usb-path Sets the USB path of the device to connect to + -a, --algorithm + The OTP algorithm to use [default: totp] [possible values: hotp, totp] + + -h, --help + Print help information + + -m, --model + Selects the device model to connect to [possible values: librem, pro, storage] + + --no-cache + Disables the cache for all secrets + + --serial-number + Sets the serial number of the device to connect to. Can be set multiple times to allow + multiple serial numbers + + --usb-path + Sets the USB path of the device to connect to + + -v, --verbose + Increases the log level (can be supplied multiple times) -ARGS: - The OTP slot to clear diff --git a/src/tests/snapshots/nitrocli__tests__run__nitrocli_otp_clear_-h.snap b/src/tests/snapshots/nitrocli__tests__run__nitrocli_otp_clear_-h.snap index f6bde61c..40a0800b 100644 --- a/src/tests/snapshots/nitrocli__tests__run__nitrocli_otp_clear_-h.snap +++ b/src/tests/snapshots/nitrocli__tests__run__nitrocli_otp_clear_-h.snap @@ -3,26 +3,37 @@ source: src/tests/run.rs expression: s --- -nitrocli-otp-clear 0.4.1 +nitrocli-otp-clear + Clears a one-time password slot USAGE: - nitrocli otp clear [FLAGS] [OPTIONS] + nitrocli otp clear [OPTIONS] -FLAGS: - -h, --help Prints help information - --no-cache Disables the cache for all secrets - -V, --version Prints version information - -v, --verbose Increases the log level (can be supplied multiple times) +ARGS: + The OTP slot to clear OPTIONS: - -a, --algorithm The OTP algorithm to use [default: totp] [possible values: hotp, totp] - -m, --model Selects the device model to connect to [possible values: librem, pro, - storage] - --serial-number ... Sets the serial number of the device to connect to. Can be set multiple - times to allow multiple serial numbers - --usb-path Sets the USB path of the device to connect to + -a, --algorithm + The OTP algorithm to use [default: totp] [possible values: hotp, totp] + + -h, --help + Print help information + + -m, --model + Selects the device model to connect to [possible values: librem, pro, storage] + + --no-cache + Disables the cache for all secrets + + --serial-number + Sets the serial number of the device to connect to. Can be set multiple times to allow + multiple serial numbers + + --usb-path + Sets the USB path of the device to connect to + + -v, --verbose + Increases the log level (can be supplied multiple times) -ARGS: - The OTP slot to clear diff --git a/src/tests/snapshots/nitrocli__tests__run__nitrocli_otp_get_--help.snap b/src/tests/snapshots/nitrocli__tests__run__nitrocli_otp_get_--help.snap index 7c85948d..640b17de 100644 --- a/src/tests/snapshots/nitrocli__tests__run__nitrocli_otp_get_--help.snap +++ b/src/tests/snapshots/nitrocli__tests__run__nitrocli_otp_get_--help.snap @@ -3,28 +3,40 @@ source: src/tests/run.rs expression: s --- -nitrocli-otp-get 0.4.1 +nitrocli-otp-get + Generates a one-time password USAGE: - nitrocli otp get [FLAGS] [OPTIONS] + nitrocli otp get [OPTIONS] -FLAGS: - -h, --help Prints help information - --no-cache Disables the cache for all secrets - -V, --version Prints version information - -v, --verbose Increases the log level (can be supplied multiple times) +ARGS: + The OTP slot to use OPTIONS: - -a, --algorithm The OTP algorithm to use [default: totp] [possible values: hotp, totp] - -m, --model Selects the device model to connect to [possible values: librem, pro, - storage] - --serial-number ... Sets the serial number of the device to connect to. Can be set multiple - times to allow multiple serial numbers - -t, --time