diff options
Diffstat (limited to 'contrib/sitecopy')
-rw-r--r-- | contrib/sitecopy | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/contrib/sitecopy b/contrib/sitecopy index abf3d928..616bc5e4 100644 --- a/contrib/sitecopy +++ b/contrib/sitecopy @@ -8,20 +8,20 @@ _sitecopy() local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur - case "$cur" in + case $cur in --*) - COMPREPLY=( $( compgen -W "$(sitecopy -h | grep -e '--\w' | \ + COMPREPLY=( $( compgen -W "$(sitecopy -h | command grep -e '--\w' |\ awk '{sub (/=(FILE|PATH)/, "", $2); print $2}')" -- "$cur" ) ) ;; -*) - COMPREPLY=( $( compgen -W "$(sitecopy -h | grep -e '-\w' | \ + COMPREPLY=( $( compgen -W "$(sitecopy -h | command grep -e '-\w' | \ awk '{sub (",", "", $1); print $1}')" -- "$cur" ) ) ;; *) if [ -r ~/.sitecopyrc ]; then - COMPREPLY=( $( compgen -W "$(grep '^["$'\t '"]*site' \ + COMPREPLY=( $( compgen -W "$(command grep '^["$'\t '"]*site' \ ~/.sitecopyrc | awk '{print $2}')" -- "$cur" ) ) fi ;; @@ -29,7 +29,7 @@ _sitecopy() return 0 } && -complete -F _sitecopy $default sitecopy +complete -F _sitecopy -o default sitecopy # Local variables: # mode: shell-script |