mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 22:50:14 +02:00
Restrict short-hand flag detection to exact match. (#1406)
This commit is contained in:
committed by
GitHub
parent
0f7c723672
commit
18d988d4c8
@ -368,8 +368,13 @@ impl SpannedToken {
|
||||
|
||||
match flag.kind {
|
||||
FlagKind::Longhand if value == name => Some(*flag),
|
||||
FlagKind::Shorthand if short.is_some() && short == name.chars().next() => {
|
||||
Some(*flag)
|
||||
FlagKind::Shorthand => {
|
||||
if let Some(short_hand) = short {
|
||||
if short_hand.to_string() == name {
|
||||
return Some(*flag);
|
||||
}
|
||||
}
|
||||
None
|
||||
}
|
||||
_ => None,
|
||||
}
|
||||
|
Reference in New Issue
Block a user