File tree Expand file tree Collapse file tree 5 files changed +17
-11
lines changed Expand file tree Collapse file tree 5 files changed +17
-11
lines changed Original file line number Diff line number Diff line change @@ -2834,12 +2834,17 @@ complete -F _comp_complete_longopt \
2834
2834
2835
2835
declare -Ag _xspecs
2836
2836
2837
- # TODO:API: rename per conventions
2838
- _filedir_xspec ()
2837
+ # @since 2.12
2838
+ _comp_complete_filedir_xspec ()
2839
2839
{
2840
2840
local cur prev words cword comp_args
2841
2841
_comp_initialize -- " $@ " || return
2842
+ _comp_compgen_filedir_xspec " $1 "
2843
+ }
2842
2844
2845
+ # @since 2.12
2846
+ _comp_compgen_filedir_xspec()
2847
+ {
2843
2848
_comp_compgen_tilde && return
2844
2849
2845
2850
local ret
@@ -2868,10 +2873,10 @@ _filedir_xspec()
2868
2873
${# toks[@]} -lt 1 ]] &&
2869
2874
_comp_compgen -av toks -c " $quoted " -- -f
2870
2875
2871
- if ((${# toks[@]} != 0)); then
2872
- compopt -o filenames
2873
- COMPREPLY=( " ${toks[@]} " )
2874
- fi
2876
+ ((${# toks[@]} )) || return 1
2877
+
2878
+ compopt -o filenames
2879
+ _comp_compgen -RU toks -- -W ' " ${toks[@]} " '
2875
2880
}
2876
2881
2877
2882
# TODO:API: rename per conventions
@@ -3064,7 +3069,7 @@ __load_completion()
3064
3069
3065
3070
# Look up simple " xspec" completions
3066
3071
[[ -v _xspecs[$cmdname ] ]] &&
3067
- complete -F _filedir_xspec " $cmdname " " $backslash$cmdname " && return 0
3072
+ complete -F _comp_complete_filedir_xspec " $cmdname " " $backslash$cmdname " && return 0
3068
3073
3069
3074
return 1
3070
3075
}
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ _comp_deprecate_func 2.12 _service _comp_complete_service
32
32
_comp_deprecate_func 2.12 _user_at_host _comp_complete_user_at_host
33
33
_comp_deprecate_func 2.12 _known_hosts _comp_complete_known_hosts
34
34
_comp_deprecate_func 2.12 _longopt _comp_complete_longopt
35
+ _comp_deprecate_func 2.12 _filedir_xspec _comp_complete_filedir_xspec
35
36
36
37
# Backwards compatibility for compat completions that use have().
37
38
# @deprecated 1.90 should no longer be used; generally not needed with
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ _comp_cmd_7z()
87
87
local args
88
88
_count_args " ="
89
89
if (( args == 2 )) ; then
90
- _filedir_xspec unzip " ${ @: 2} "
90
+ _comp_compgen_filedir_xspec unzip
91
91
# TODO: parsing 7z i output?
92
92
# - how to figure out if the format is input or output?
93
93
# - find string Formats:, read until next empty line
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ _comp_cmd_file_roller()
18
18
return
19
19
;;
20
20
--add-to | -${noargopts} a)
21
- _filedir_xspec unzip " ${ @: 2} "
21
+ _comp_compgen_filedir_xspec unzip
22
22
_comp_compgen -a filedir " $exts "
23
23
return
24
24
;;
@@ -36,7 +36,7 @@ _comp_cmd_file_roller()
36
36
return
37
37
fi
38
38
39
- _filedir_xspec unzip " ${ @: 2} "
39
+ _comp_compgen_filedir_xspec unzip
40
40
_comp_compgen -a filedir " $exts "
41
41
} &&
42
42
complete -F _comp_cmd_file_roller file-roller
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ _comp_cmd_jar()
15
15
_comp_compgen_filedir
16
16
;;
17
17
* f)
18
- _filedir_xspec unzip " ${ @: 2} "
18
+ _comp_compgen_filedir_xspec unzip
19
19
;;
20
20
* )
21
21
_comp_compgen_filedir
You can’t perform that action at this time.
0 commit comments