@@ -1012,7 +1012,7 @@ _comp_variable_assignments()
1012
1012
case $prev in
1013
1013
TZ)
1014
1014
cur=/usr/share/zoneinfo/$cur
1015
- _filedir
1015
+ _comp_compgen -a filedir
1016
1016
if (( ${# COMPREPLY[@]} )) ; then
1017
1017
for i in " ${! COMPREPLY[@]} " ; do
1018
1018
if [[ ${COMPREPLY[i]} == * .tab ]]; then
@@ -1037,7 +1037,7 @@ _comp_variable_assignments()
1037
1037
;;
1038
1038
* )
1039
1039
_variables && return 0
1040
- _filedir
1040
+ _comp_compgen -a filedir
1041
1041
;;
1042
1042
esac
1043
1043
@@ -1052,9 +1052,12 @@ _comp_variable_assignments()
1052
1052
#
1053
1053
# Options:
1054
1054
# -n EXCLUDE Passed to _comp_get_words -n with redirection chars
1055
- # -e XSPEC Passed to _filedir as first arg for stderr redirections
1056
- # -o XSPEC Passed to _filedir as first arg for other output redirections
1057
- # -i XSPEC Passed to _filedir as first arg for stdin redirections
1055
+ # -e XSPEC Passed to _comp_compgen_filedir as first arg for stderr
1056
+ # redirections
1057
+ # -o XSPEC Passed to _comp_compgen_filedir as first arg for other output
1058
+ # redirections
1059
+ # -i XSPEC Passed to _comp_compgen_filedir as first arg for stdin
1060
+ # redirections
1058
1061
# -s Split long options with _comp__split_longopt, implies -n =
1059
1062
# @param $1...$3 args Original arguments specified to the completion function.
1060
1063
# The first argument $1 is command name. The second
@@ -1065,9 +1068,9 @@ _comp_variable_assignments()
1065
1068
# @var[out] prev Reconstructed previous word
1066
1069
# @var[out] words Reconstructed words
1067
1070
# @var[out] cword Current word index in `words`
1068
- # @var[out] comp_args Original arguments specified to the completion function
1069
- # are saved in this array, if the arguments $1...$3 is
1070
- # specified.
1071
+ # @var[out] comp_args Original arguments specified to the completion
1072
+ # function are saved in this array, if the arguments
1073
+ # $1...$3 is specified.
1071
1074
# @var[out,opt] was_split When "-s" is specified, `"set"/""` is set depending
1072
1075
# on whether the split happened.
1073
1076
# @return True (0) if completion needs further processing,
@@ -1123,7 +1126,7 @@ _comp_initialize()
1123
1126
;;
1124
1127
esac
1125
1128
cur=${cur## " $redir " }
1126
- _filedir " $xspec "
1129
+ _comp_compgen -a filedir " $xspec "
1127
1130
return 1
1128
1131
fi
1129
1132
@@ -2469,23 +2472,23 @@ _comp_longopt()
2469
2472
return
2470
2473
;;
2471
2474
--! (no-* )dir* )
2472
- _filedir -d
2475
+ _comp_compgen -a filedir -d
2473
2476
return
2474
2477
;;
2475
2478
--! (no-* )@ (file| path)* )
2476
- _filedir
2479
+ _comp_compgen -a filedir
2477
2480
return
2478
2481
;;
2479
2482
--+ ([-a-z0-9_]))
2480
2483
local argtype=$( LC_ALL=C $1 --help 2>&1 | command sed -ne \
2481
2484
" s|.*$prev \[\{0,1\}=[<[]\{0,1\}\([-A-Za-z0-9_]\{1,\}\).*|\1|p" )
2482
2485
case ${argtype,,} in
2483
2486
* dir* )
2484
- _filedir -d
2487
+ _comp_compgen -a filedir -d
2485
2488
return
2486
2489
;;
2487
2490
* file* | * path* )
2488
- _filedir
2491
+ _comp_compgen -a filedir
2489
2492
return
2490
2493
;;
2491
2494
esac
@@ -2502,10 +2505,10 @@ _comp_longopt()
2502
2505
done)"
2503
2506
[[ ${COMPREPLY-} == *= ]] && compopt -o nospace
2504
2507
elif [[ $1 == *@(rmdir|chroot) ]]; then
2505
- _filedir -d
2508
+ _comp_compgen -a filedir -d
2506
2509
else
2507
2510
[[ $1 == *mkdir ]] && compopt -o nospace
2508
- _filedir
2511
+ _comp_compgen -a filedir
2509
2512
fi
2510
2513
}
2511
2514
# makeinfo and texi2dvi are defined elsewhere.
0 commit comments