.bash_completion
changeset 1038 79c56b8fb8e0
parent 1017 0d77f5f13675
equal deleted inserted replaced
1037:b386e087b97f 1038:79c56b8fb8e0
    32 # type and which complete on commands
    32 # type and which complete on commands
    33 complete -c command type which
    33 complete -c command type which
    34 
    34 
    35 # builtin completes on builtins
    35 # builtin completes on builtins
    36 complete -b builtin
    36 complete -b builtin
    37 
       
    38 _hgsync() {
       
    39   local cur=${COMP_WORDS[COMP_CWORD]}
       
    40   case $COMP_CWORD in
       
    41     0|1)
       
    42       COMPREPLY=( $(compgen -W "local remote pull push info status help --help" -- $cur) )
       
    43       compopt +o nospace
       
    44       return ;;
       
    45     2)
       
    46       COMPREPLY=( $(compgen -d -S / -- "$cur") )
       
    47       return ;;
       
    48     *)
       
    49       COMPREPLY=( )
       
    50       return ;;
       
    51   esac
       
    52 }
       
    53 complete -F _hgsync -o nospace hgsync
       
    54 
    37 
    55 _pathsearch() {
    38 _pathsearch() {
    56   local prev cur=${COMP_WORDS[COMP_CWORD]}
    39   local prev cur=${COMP_WORDS[COMP_CWORD]}
    57   [[ $COMP_CWORD > 0 ]] && prev=${COMP_WORDS[COMP_CWORD-1]}
    40   [[ $COMP_CWORD > 0 ]] && prev=${COMP_WORDS[COMP_CWORD-1]}
    58   if [[ $prev = -d ]]; then
    41   if [[ $prev = -d ]]; then