mirror of
https://github.com/nushell/nushell.git
synced 2025-08-10 01:17:47 +02:00
Explicitly indicate duplicate flags (#11226)
# Description This PR adds an explicit indication for duplicate flags, which helps with debugging. # User-Facing Changes N/A # Tests + Formatting - [x] `cargo fmt --all -- --check` to check standard code formatting (`cargo fmt --all` applies these changes) - [x] `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to check that you're using the standard code style - [x] `cargo test --workspace` to check that all tests pass (on Windows make sure to [enable developer mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging)) - [x] `cargo run -- -c "use std testing; testing run-tests --path crates/nu-std"` to run the tests for the standard library # After Submitting N/A
This commit is contained in:
@ -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
|
||||
};
|
||||
|
Reference in New Issue
Block a user