aboutsummaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorRobin Krahl <robin.krahl@ireas.org>2020-09-29 19:18:56 +0200
committerDaniel Mueller <deso@posteo.net>2020-10-11 16:26:54 -0700
commitaaf0286994fcffa8dc81a2569ad70ec6fd7c9b90 (patch)
tree00b8e65562302ab7148c5659708578b3bfb42c6f /src/tests
parent6be92c8425dd5285c16a1722aa95683ea146cf46 (diff)
downloadnitrocli-aaf0286994fcffa8dc81a2569ad70ec6fd7c9b90.tar.gz
nitrocli-aaf0286994fcffa8dc81a2569ad70ec6fd7c9b90.tar.bz2
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.
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/config.rs16
1 files changed, 8 insertions, 8 deletions
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 <numlock>' cannot be used with '--no-numlock'"),
+ err.contains("The argument '--num-lock <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)
$"#,
)