From 105ec0c89fa329f5746700827b02dc1373e63ec5 Mon Sep 17 00:00:00 2001 From: Piepmatz Date: Wed, 2 Jul 2025 12:31:01 +0200 Subject: [PATCH] Allow dashes in experimental option identifiers (#16093) # Description In #16028 I also added a test to check that identifiers are valid to ensure that we have consistency there. But I only checked for alphanumeric strings as identifiers. It doesn't allow underscores or dashes. @Bahex used in his PR about #15682 a dash to separate words. So expanded the test to allow that. # User-Facing Changes None. # Tests + Formatting The `assert_identifiers_are_valid` now allows dashes. # After Submitting The tests in #15682 should work then. --- crates/nu-experimental/src/options/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/nu-experimental/src/options/mod.rs b/crates/nu-experimental/src/options/mod.rs index 343629eb51..7a5a711ccb 100644 --- a/crates/nu-experimental/src/options/mod.rs +++ b/crates/nu-experimental/src/options/mod.rs @@ -75,7 +75,7 @@ mod tests { assert!(first.is_lowercase()); for char in chars { - assert!(char.is_alphanumeric()); + assert!(char.is_alphanumeric() || char == '-'); if char.is_alphabetic() { assert!(char.is_lowercase()); }