Skip to content

Commit 7920c9d

Browse files
committed
feat(_comp_compgen_{filedir,set}): define exit status
1 parent 47d7683 commit 7920c9d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

bash_completion

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,12 +665,14 @@ _comp_compgen()
665665
# caller _comp_compgen, the words are appended to the existing elements of the
666666
# array instead of replacing the existing elements. This function ignores
667667
# ${cur-} or the prefix specified by `-v CUR`.
668+
# @return 0 if at least one completion is generated, or 1 otherwise.
668669
# @since 2.12
669670
_comp_compgen_set()
670671
{
671672
local _append=${_comp_compgen__append-}
672673
local _var=${_comp_compgen__var-COMPREPLY}
673674
eval -- "$_var${_append:++}=(\"\$@\")"
675+
(($#))
674676
}
675677

676678
# Simply split the text and generate completions. This function should be used
@@ -1004,6 +1006,7 @@ _comp_quote_compgen()
10041006
# @param $1 If `-d', complete only on directories. Otherwise filter/pick only
10051007
# completions with `.$1' and the uppercase version of it as file
10061008
# extension.
1009+
# @return 0 if at least one completion is generated, or 1 otherwise.
10071010
#
10081011
# @since 2.12
10091012
_comp_compgen_filedir()

0 commit comments

Comments
 (0)