@@ -1016,7 +1016,7 @@ _comp_variable_assignments()
10161016 case $prev in
10171017 TZ)
10181018 cur=/usr/share/zoneinfo/$cur
1019- _filedir
1019+ _comp_compgen -a filedir
10201020 if (( ${# COMPREPLY[@]} )) ; then
10211021 for i in " ${! COMPREPLY[@]} " ; do
10221022 if [[ ${COMPREPLY[i]} == * .tab ]]; then
@@ -1041,7 +1041,7 @@ _comp_variable_assignments()
10411041 ;;
10421042 * )
10431043 _variables && return 0
1044- _filedir
1044+ _comp_compgen -a filedir
10451045 ;;
10461046 esac
10471047
@@ -1056,9 +1056,12 @@ _comp_variable_assignments()
10561056#
10571057# Options:
10581058# -n EXCLUDE Passed to _comp_get_words -n with redirection chars
1059- # -e XSPEC Passed to _filedir as first arg for stderr redirections
1060- # -o XSPEC Passed to _filedir as first arg for other output redirections
1061- # -i XSPEC Passed to _filedir as first arg for stdin redirections
1059+ # -e XSPEC Passed to _comp_compgen_filedir as first arg for stderr
1060+ # redirections
1061+ # -o XSPEC Passed to _comp_compgen_filedir as first arg for other output
1062+ # redirections
1063+ # -i XSPEC Passed to _comp_compgen_filedir as first arg for stdin
1064+ # redirections
10621065# -s Split long options with _comp__split_longopt, implies -n =
10631066# @param $1...$3 args Original arguments specified to the completion function.
10641067# The first argument $1 is command name. The second
@@ -1069,9 +1072,9 @@ _comp_variable_assignments()
10691072# @var[out] prev Reconstructed previous word
10701073# @var[out] words Reconstructed words
10711074# @var[out] cword Current word index in `words`
1072- # @var[out] comp_args Original arguments specified to the completion function
1073- # are saved in this array, if the arguments $1...$3 is
1074- # specified.
1075+ # @var[out] comp_args Original arguments specified to the completion
1076+ # function are saved in this array, if the arguments
1077+ # $1...$3 is specified.
10751078# @var[out,opt] was_split When "-s" is specified, `"set"/""` is set depending
10761079# on whether the split happened.
10771080# @return True (0) if completion needs further processing,
@@ -1127,7 +1130,7 @@ _comp_initialize()
11271130 ;;
11281131 esac
11291132 cur=${cur## " $redir " }
1130- _filedir " $xspec "
1133+ _comp_compgen -a filedir " $xspec "
11311134 return 1
11321135 fi
11331136
@@ -2473,23 +2476,23 @@ _comp_longopt()
24732476 return
24742477 ;;
24752478 --! (no-* )dir* )
2476- _filedir -d
2479+ _comp_compgen -a filedir -d
24772480 return
24782481 ;;
24792482 --! (no-* )@ (file| path)* )
2480- _filedir
2483+ _comp_compgen -a filedir
24812484 return
24822485 ;;
24832486 --+ ([-a-z0-9_]))
24842487 local argtype=$( LC_ALL=C $1 --help 2>&1 | command sed -ne \
24852488 " s|.*$prev \[\{0,1\}=[<[]\{0,1\}\([-A-Za-z0-9_]\{1,\}\).*|\1|p" )
24862489 case ${argtype,,} in
24872490 * dir* )
2488- _filedir -d
2491+ _comp_compgen -a filedir -d
24892492 return
24902493 ;;
24912494 * file* | * path* )
2492- _filedir
2495+ _comp_compgen -a filedir
24932496 return
24942497 ;;
24952498 esac
@@ -2506,10 +2509,10 @@ _comp_longopt()
25062509 done)"
25072510 [[ ${COMPREPLY-} == *= ]] && compopt -o nospace
25082511 elif [[ $1 == *@(rmdir|chroot) ]]; then
2509- _filedir -d
2512+ _comp_compgen -a filedir -d
25102513 else
25112514 [[ $1 == *mkdir ]] && compopt -o nospace
2512- _filedir
2515+ _comp_compgen -a filedir
25132516 fi
25142517}
25152518# makeinfo and texi2dvi are defined elsewhere.
0 commit comments