mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-11-14 01:20:31 +03:00
Dont count bash's idiotic option equals as arguments
This commit is contained in:
parent
a2bb360eec
commit
ef9b765f81
@ -146,20 +146,23 @@ func default_parse_args(cmd *Command, words []string, completions *Completions)
|
||||
completions.current_word_idx = i
|
||||
completions.current_word_idx_in_parent++
|
||||
is_last_word := i == len(words)-1
|
||||
is_option_equal := completions.split_on_equals && word == "=" && expecting_arg_for != nil
|
||||
if only_args_allowed || (expecting_arg_for == nil && !strings.HasPrefix(word, "-")) {
|
||||
arg_num++
|
||||
if !is_option_equal {
|
||||
arg_num++
|
||||
}
|
||||
if arg_num == 1 {
|
||||
cmd.index_of_first_arg = completions.current_word_idx
|
||||
}
|
||||
}
|
||||
if is_last_word {
|
||||
if completions.split_on_equals && word == "=" {
|
||||
if is_option_equal {
|
||||
word = ""
|
||||
}
|
||||
complete_word(word, completions, only_args_allowed, expecting_arg_for, arg_num)
|
||||
} else {
|
||||
if expecting_arg_for != nil {
|
||||
if completions.split_on_equals && word == "=" {
|
||||
if is_option_equal {
|
||||
continue
|
||||
}
|
||||
expecting_arg_for = nil
|
||||
|
Loading…
Reference in New Issue
Block a user