.bash_completion
changeset 1007 0077617b0deb
parent 972 27754771cbb6
child 1011 48975083716e
equal deleted inserted replaced
1006:ad4478dd89fc 1007:0077617b0deb
    39   local cur=${COMP_WORDS[COMP_CWORD]}
    39   local cur=${COMP_WORDS[COMP_CWORD]}
    40   COMPREPLY=( $(compgen -W "--push --modified" -- $cur) )
    40   COMPREPLY=( $(compgen -W "--push --modified" -- $cur) )
    41   return 0
    41   return 0
    42 }
    42 }
    43 complete -F _hgsyncew -o nospace hgsyncew
    43 complete -F _hgsyncew -o nospace hgsyncew
       
    44 
       
    45 _hgsync() {
       
    46   local cur=${COMP_WORDS[COMP_CWORD]}
       
    47   case $COMP_CWORD in
       
    48     0|1)
       
    49       COMPREPLY=( $(compgen -W "local remote pull push info --help" -- $cur) )
       
    50       compopt +o nospace
       
    51       return ;;
       
    52     2)
       
    53       COMPREPLY=( $(compgen -d -S / -- "$cur") )
       
    54       return ;;
       
    55     *)
       
    56       COMPREPLY=( )
       
    57       return ;;
       
    58   esac
       
    59 }
       
    60 complete -F _hgsync -o nospace hgsync
    44 
    61 
    45 _pathsearch() {
    62 _pathsearch() {
    46   local prev cur=${COMP_WORDS[COMP_CWORD]}
    63   local prev cur=${COMP_WORDS[COMP_CWORD]}
    47   [[ $COMP_CWORD > 0 ]] && prev=${COMP_WORDS[COMP_CWORD-1]}
    64   [[ $COMP_CWORD > 0 ]] && prev=${COMP_WORDS[COMP_CWORD-1]}
    48   if [[ $prev = -d ]]; then
    65   if [[ $prev = -d ]]; then