diff options
Diffstat (limited to 'completions/getent')
-rw-r--r-- | completions/getent | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/completions/getent b/completions/getent index 0658b0bb..9a181f60 100644 --- a/completions/getent +++ b/completions/getent @@ -8,10 +8,10 @@ _getent() local i db for (( i=1; i < cword; i++ )); do case ${words[i]} in - -V|--version|--usage|-'?'|--help) + --version|--usage|--help|-!(-*)[V?]) return ;; - -s|--service) + --service|-!(-*)s) (( i++ )) ;; -*) @@ -26,29 +26,28 @@ _getent() case $db in passwd) - COMPREPLY=( $( compgen -u -- "$cur" ) ) + COMPREPLY=( $(compgen -u -- "$cur") ) return ;; group) - COMPREPLY=( $( compgen -g -- "$cur" ) ) + COMPREPLY=( $(compgen -g -- "$cur") ) return ;; services) - COMPREPLY=( $( compgen -s -- "$cur" ) ) + COMPREPLY=( $(compgen -s -- "$cur") ) return ;; hosts) - COMPREPLY=( $( compgen -A hostname -- "$cur" ) ) + COMPREPLY=( $(compgen -A hostname -- "$cur") ) return ;; protocols|networks|ahosts|ahostsv4|ahostsv6|rpc) - COMPREPLY=( $( compgen -W "$( $1 $db | \ - awk '{ print $1 }' )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$($1 $db | \ + awk '{ print $1 }')" -- "$cur") ) return ;; aliases|shadow|gshadow) - COMPREPLY=( $( compgen -W "$( $1 $db | cut -d: -f1 )" \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$($1 $db | cut -d: -f1)" -- "$cur") ) return ;; ethers|netgroup) @@ -65,12 +64,12 @@ _getent() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace elif [[ -z $db ]]; then - COMPREPLY=( $( compgen -W 'passwd group hosts services protocols + COMPREPLY=( $(compgen -W 'passwd group hosts services protocols networks ahosts ahostsv4 ahostsv6 aliases ethers netgroup rpc - shadow gshadow' -- "$cur" ) ) + shadow gshadow' -- "$cur") ) fi } && complete -F _getent getent |