From aaf0286994fcffa8dc81a2569ad70ec6fd7c9b90 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Tue, 29 Sep 2020 19:18:56 +0200 Subject: Rename numlock, capslock, scrollock options This patch renames the options for the config set command: --numlock ==> --num-lock --capslock ==> --caps-lock --scrolllock ==> --scroll-lock --no-numlock ==> --no-num-lock --no-capslock ==> --no-caps-lock --no-scrolllock ==> --no-scroll-lock The original naming was based on a typo in nitrokey-rs (scrollock vs. scrolllock). Also, the typical spelling for the keys is Num Lock, Caps Lock and Scroll Lock, so using a hyphen is a more natural. --- src/tests/config.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/tests') diff --git a/src/tests/config.rs b/src/tests/config.rs index babd32c..b3d27de 100644 --- a/src/tests/config.rs +++ b/src/tests/config.rs @@ -26,9 +26,9 @@ fn mutually_exclusive_set_options() { fn get(model: nitrokey::Model) -> anyhow::Result<()> { let re = regex::Regex::new( r#"^Config: - numlock binding: (not set|\d+) - capslock binding: (not set|\d+) - scrollock binding: (not set|\d+) + num lock binding: (not set|\d+) + caps lock binding: (not set|\d+) + scroll lock binding: (not set|\d+) require user PIN for OTP: (true|false) $"#, ) @@ -44,12 +44,12 @@ $"#, fn set_wrong_usage(model: nitrokey::Model) { let err = Nitrocli::new() .model(model) - .handle(&["config", "set", "--numlock", "2", "-N"]) + .handle(&["config", "set", "--num-lock", "2", "-N"]) .unwrap_err() .to_string(); assert!( - err.contains("The argument '--numlock ' cannot be used with '--no-numlock'"), + err.contains("The argument '--num-lock ' cannot be used with '--no-num-lock'"), err, ); } @@ -61,9 +61,9 @@ fn set_get(model: nitrokey::Model) -> anyhow::Result<()> { let re = regex::Regex::new( r#"^Config: - numlock binding: not set - capslock binding: 0 - scrollock binding: 1 + num lock binding: not set + caps lock binding: 0 + scroll lock binding: 1 require user PIN for OTP: (true|false) $"#, ) -- cgit v1.2.3