diff --git a/crates/nu-protocol/src/signature.rs b/crates/nu-protocol/src/signature.rs index e054378730..263eaeb432 100644 --- a/crates/nu-protocol/src/signature.rs +++ b/crates/nu-protocol/src/signature.rs @@ -469,7 +469,8 @@ impl Signature { let s = short.map(|c| { debug_assert!( !self.get_shorts().contains(&c), - "There may be duplicate short flags, such as -h" + "There may be duplicate short flags for '-{}'", + c ); c }); @@ -478,7 +479,8 @@ impl Signature { let name: String = name.into(); debug_assert!( !self.get_names().contains(&name.as_str()), - "There may be duplicate name flags, such as --help" + "There may be duplicate name flags for '--{}'", + name ); name }; diff --git a/crates/nu-protocol/tests/test_signature.rs b/crates/nu-protocol/tests/test_signature.rs index 000abb0d00..e22029bab9 100644 --- a/crates/nu-protocol/tests/test_signature.rs +++ b/crates/nu-protocol/tests/test_signature.rs @@ -96,7 +96,7 @@ fn test_signature_chained() { } #[test] -#[should_panic(expected = "There may be duplicate short flags, such as -h")] +#[should_panic(expected = "There may be duplicate short flags for '-n'")] fn test_signature_same_short() { // Creating signature with same short name should panic Signature::new("new_signature") @@ -110,7 +110,7 @@ fn test_signature_same_short() { } #[test] -#[should_panic(expected = "There may be duplicate name flags, such as --help")] +#[should_panic(expected = "There may be duplicate name flags for '--name'")] fn test_signature_same_name() { // Creating signature with same short name should panic Signature::new("new-signature")