diff --git a/src/complete.rs b/src/complete.rs index fa581f84d..345babfb6 100644 --- a/src/complete.rs +++ b/src/complete.rs @@ -908,7 +908,6 @@ fn short_option_pos(&mut self, arg: &wstr, options: &[CompleteEntryOpt]) -> Opti return None; } - let mut seen_short_options = HashSet::new(); for (pos, arg_char) in arg.chars().enumerate().skip(1) { let matched = options.iter().find(|o| { o.typ == CompleteOptionType::Short @@ -920,9 +919,6 @@ fn short_option_pos(&mut self, arg: &wstr, options: &[CompleteEntryOpt]) -> Opti if matched.result_mode.requires_param { return Some(pos); } - if !seen_short_options.insert(arg_char) { - return None; - } } else { // The first character after the dash is not a valid option. if pos == 1 { diff --git a/tests/checks/complete.fish b/tests/checks/complete.fish index 21ab96bc2..d0ef6b0f3 100644 --- a/tests/checks/complete.fish +++ b/tests/checks/complete.fish @@ -153,10 +153,11 @@ end complete -c repeated_short_options -f -s h complete -c repeated_short_options -f -s v complete -c repeated_short_options -f -s x -complete -C'repeated_short_options -xx' | count -# CHECK: 0 -complete -C'repeated_short_options -xxh' | count -# CHECK: 0 +complete -C'repeated_short_options -xx' +# CHECK: -xxh +# CHECK: -xxv +complete -C'repeated_short_options -xxh' +# CHECK: -xxhv complete -C'repeated_short_options -x' # CHECK: -xh # CHECK: -xv