Skip to content

Commit 177470b

Browse files
committed
fix(_comp_count_args): skip reassembling cword and words
These completions induce reassembling `cword` and `words` inside `_comp_count_args`, but they are likely to be intended as the same as the outside `cword` and `words`. We just skip the reassembling by dropping `-n ""` or `-n :`.
1 parent dbf7beb commit 177470b

File tree

8 files changed

+12
-12
lines changed

8 files changed

+12
-12
lines changed

completions/chmod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ _comp_cmd_chmod()
2828
fi
2929

3030
local ret
31-
_comp_count_args -n "" -i "$modearg"
31+
_comp_count_args -i "$modearg"
3232

3333
case $ret in
3434
1) ;; # mode

completions/chown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ _comp_cmd_chown()
3232
local ret
3333

3434
# The first argument is a usergroup; the rest are filedir.
35-
_comp_count_args -n :
35+
_comp_count_args
3636

3737
if ((ret == 1)); then
3838
_comp_compgen_usergroup -u

completions/cryptsetup

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ _comp_cmd_cryptsetup()
3737
local ret
3838
if _comp_get_first_arg; then
3939
local arg=$ret
40-
_comp_count_args -n "" -a "-${noargopts}[chslSbopitTdM]"
40+
_comp_count_args -a "-${noargopts}[chslSbopitTdM]"
4141
local args=$ret
4242
case $arg in
4343
open | create | luksOpen | loopaesOpen | tcryptOpen)

completions/hcitool

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ _comp_cmd_hcitool()
4949
if _comp_get_first_arg; then
5050
case $ret in
5151
name | info | dc | rssi | lq | afh | auth | key | clkoff | lst)
52-
_comp_count_args -n ""
52+
_comp_count_args
5353
if ((ret == 2)); then
5454
_comp_cmd_hcitool__bluetooth_addresses
5555
fi
@@ -58,30 +58,30 @@ _comp_cmd_hcitool()
5858
if [[ $cur == -* ]]; then
5959
_comp_compgen -- -W '--role --pkt-type'
6060
else
61-
_comp_count_args -n ""
61+
_comp_count_args
6262
if ((ret == 2)); then
6363
_comp_cmd_hcitool__bluetooth_addresses
6464
fi
6565
fi
6666
;;
6767
sr)
68-
_comp_count_args -n ""
68+
_comp_count_args
6969
if ((ret == 2)); then
7070
_comp_cmd_hcitool__bluetooth_addresses
7171
else
7272
_comp_compgen -- -W 'master slave'
7373
fi
7474
;;
7575
cpt)
76-
_comp_count_args -n ""
76+
_comp_count_args
7777
if ((ret == 2)); then
7878
_comp_cmd_hcitool__bluetooth_addresses
7979
else
8080
_comp_cmd_hcitool__bluetooth_packet_types
8181
fi
8282
;;
8383
tpl | enc | clock)
84-
_comp_count_args -n ""
84+
_comp_count_args
8585
if ((ret == 2)); then
8686
_comp_cmd_hcitool__bluetooth_addresses
8787
else

completions/mkinitrd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ _comp_cmd_mkinitrd()
3131
[[ ${COMPREPLY-} == *= ]] && compopt -o nospace
3232
else
3333
local ret
34-
_comp_count_args -n ""
34+
_comp_count_args
3535

3636
case $ret in
3737
1)

completions/patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ _comp_cmd_patch()
5656
fi
5757

5858
local ret
59-
_comp_count_args -n ""
59+
_comp_count_args
6060
case $ret in
6161
1)
6262
_comp_compgen_filedir

completions/quota

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ _comp_cmd_setquota()
8484
_comp_cmd_quota__parse_help "$1"
8585
else
8686
local ret
87-
_comp_count_args -n ""
87+
_comp_count_args
8888

8989
case $ret in
9090
1)

completions/zopflipng

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ _comp_cmd_zopflipng()
2828
if [[ ${words[*]} != *\ --prefix=* ]]; then
2929
# 2 png args only if --prefix not given
3030
local ret
31-
_comp_count_args -n ""
31+
_comp_count_args
3232
((ret < 3)) && _comp_compgen_filedir png
3333
else
3434
# otherwise arbitrary number of png args

0 commit comments

Comments
 (0)