Skip to content

Commit 4d4839e

Browse files
committed
feat(_comp_compgen_commands): auto set -o filenames when appropriate
1 parent faab292 commit 4d4839e

File tree

17 files changed

+18
-20
lines changed

17 files changed

+18
-20
lines changed

bash_completion

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2709,6 +2709,8 @@ _comp_compgen_commands()
27092709
{
27102710
[[ ! ${cur-} ]] && shopt -q no_empty_cmd_completion && return
27112711
_comp_compgen -- -c
2712+
# for e.g. spaces in paths to and in command names
2713+
((${#COMPREPLY[@]} == 0)) || compopt -o filenames
27122714
}
27132715

27142716
# @since 2.12

completions/_svn

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ _comp_cmd_svn()
3838
return
3939
;;
4040
--editor-cmd | --diff-cmd | --diff3-cmd)
41-
compopt -o filenames
4241
_comp_compgen_commands
4342
return
4443
;;

completions/cpio

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ _comp_cmd_cpio()
2222
return
2323
;;
2424
--rsh-command)
25-
compopt -o filenames
2625
_comp_compgen_commands
2726
return
2827
;;

completions/fio

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ _comp_cmd_fio()
7474
return
7575
;;
7676
--trigger | --trigger-remote)
77-
compopt -o filenames
7877
_comp_compgen_commands
7978
return
8079
;;

completions/man

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ _comp_cmd_man()
2929
return
3030
;;
3131
--pager | -${noargopts}P)
32-
compopt -o filenames
3332
_comp_compgen_commands
3433
return
3534
;;

completions/perlcritic

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ _comp_cmd_perlcritic()
3131
return
3232
;;
3333
--pager)
34-
compopt -o filenames
3534
_comp_compgen_commands
3635
return
3736
;;

completions/protoc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@ _comp_cmd_protoc()
1818
return
1919
;;
2020
--plugin)
21-
if [[ $cur != *=* ]]; then
22-
compopt -o filenames
23-
_comp_compgen_commands
24-
fi
21+
[[ $cur == *=* ]] || _comp_compgen_commands
2522
return
2623
;;
2724
--proto_path | --*_out)

completions/querybts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ _comp_cmd_querybts()
1717
return
1818
;;
1919
--mbox-reader-cmd)
20-
compopt -o filenames
2120
_comp_compgen_commands
2221
return
2322
;;

completions/reportbug

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ _comp_cmd_reportbug()
3737
return
3838
;;
3939
--editor | --mua | --mbox-reader-cmd | -${noargopts}e)
40-
compopt -o filenames
4140
_comp_compgen_commands
4241
return
4342
;;

completions/rpm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ _comp_cmd_rpm()
8989
return
9090
;;
9191
--pipe)
92-
compopt -o filenames
9392
_comp_compgen_commands
9493
return
9594
;;

0 commit comments

Comments
 (0)