PageRenderTime 178ms CodeModel.GetById 176ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/bash_completion_lib/complete -o filenames/chgrp

http://github.com/brinkman83/bashrc
#! | 31 lines | 25 code | 6 blank | 0 comment | 0 complexity | 4752b13473f142b24dacfcc22a120a01 MD5 | raw file
 1comp_include _filedir _get_cword
 2
 3
 4_chgrp()
 5{
 6    local cur prev
 7
 8    COMPREPLY=()
 9    cur=`_get_cword`
10    cur=${cur//\\\\/}
11    prev=${COMP_WORDS[COMP_CWORD-1]}
12
13    # options completion
14    if [[ "$cur" == -* ]]; then
15        COMPREPLY=( $( compgen -W '-c -h -f -R -v --changes \
16        --dereference --no-dereference --silent --quiet \
17        --reference= --recursive --verbose --help --version' -- $cur ) )
18        return 0
19    fi
20
21    # first parameter on line or first since an option?
22    if [ $COMP_CWORD -eq 1 ] && [[ "$cur" != -* ]] || \
23       [[ "$prev" == -* ]] && [ -n "$bash205" ]; then
24        local IFS=$'\n'
25        COMPREPLY=( $( compgen -g $cur 2>/dev/null ) )
26    else
27        _filedir || return 0
28    fi
29
30    return 0
31}