File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -7,10 +7,16 @@ _comp_cmd_env()
7
7
8
8
local i noargopts=' !(-*|*[uCS]*)'
9
9
for (( i = 1 ; i <= cword; i++ )) ; do
10
- if [[ ${words[i]} != -* && ${words[i]} != * = * ]]; then
11
- _comp_command_offset $i
12
- return
10
+ if [[ ${words[i]} != -* ]]; then
11
+ for (( ; i <= cword; i++ )) ; do
12
+ if [[ ${words[i]} != * = * ]]; then
13
+ _comp_command_offset " $i "
14
+ return
15
+ fi
16
+ done
17
+ break
13
18
fi
19
+
14
20
# shellcheck disable=SC2254
15
21
[[ ${words[i]} == @ (--@ (unset| chdir| split-string)| -${noargopts} [uCS]) ]] &&
16
22
(( i++ ))
Original file line number Diff line number Diff line change @@ -22,10 +22,13 @@ def test_lang_envvar(self, completion):
22
22
"" ,
23
23
"foo=bar" ,
24
24
"--debug" ,
25
- "foo=bar --debug" ,
26
25
"--debug foo=bar" ,
27
26
],
28
27
)
29
28
def test_command (self , bash , opts ):
30
29
completion = assert_complete (bash , "env %s s" % opts )
31
30
assert completion == "h" or "sh" in completion
31
+
32
+ @pytest .mark .complete ("env foo=bar --debug s" )
33
+ def test_option_like_command_after_assignment (self , completion ):
34
+ assert not (completion == "h" or "sh" in completion )
You can’t perform that action at this time.
0 commit comments