Fix broken _allowed_groups usage (shadow and coreutils)

This commit is contained in:
David Paleino 2011-03-27 12:40:44 +02:00
parent a73774c833
commit 42b107bcfc
3 changed files with 6 additions and 3 deletions

View File

@ -13,6 +13,7 @@ bash-completion (2.x)
[ David Paleino ]
* If _filedir 'ext' returns nothing, just fallback to generic
file completion. Patch by Clint Byrum (Debian: #619014, LP: #533985)
* Fix broken _allowed_groups usage (shadow and coreutils)
[ Freddy Vulto ]
* Improve __reassemble_comp_words_by_ref() to not create words of

View File

@ -84,7 +84,7 @@ _chgrp()
# first parameter on line or first since an option?
if [[ $COMP_CWORD -eq 1 && "$cur" != -* || "$prev" == -* ]]; then
_allowed_groups
_allowed_groups "$cur"
else
_filedir || return 0
fi

View File

@ -317,10 +317,12 @@ have newgrp &&
_newgrp()
{
COMPREPLY=()
if [[ "`_get_cword`" == "-" ]]; then
_get_comp_words_by_ref cur
if [[ "$cur" == "-" ]]; then
COMPREPLY=( - )
else
_allowed_groups
_allowed_groups "$cur"
fi
} &&
complete -F _newgrp newgrp