contrib/bash_completion
changeset 1639 dbfc04a55607
parent 1638 1c75487badd6
child 1641 1ef060ae7966
equal deleted inserted replaced
1638:1c75487badd6 1639:dbfc04a55607
    37     done
    37     done
    38 }
    38 }
    39 
    39 
    40 _hg_status()
    40 _hg_status()
    41 {
    41 {
    42     local files="$( hg status -$1 . | cut -b 3- )"
    42     local files="$( hg status -n$1 . )"
    43     COMPREPLY=(${COMPREPLY[@]:-} $( compgen -W "$files" -- "$cur" ))
    43     COMPREPLY=(${COMPREPLY[@]:-} $( compgen -W "$files" -- "$cur" ))
    44 }
    44 }
    45 
    45 
    46 _hg_tags()
    46 _hg_tags()
    47 {
    47 {
   138 	;;
   138 	;;
   139 	add)
   139 	add)
   140 	    _hg_status "u"
   140 	    _hg_status "u"
   141 	;;
   141 	;;
   142 	commit)
   142 	commit)
   143 	    _hg_status "mra"
   143 	    _hg_status "mar"
   144 	;;
   144 	;;
   145 	remove)
   145 	remove)
   146 	    _hg_status "r"
   146 	    _hg_status "d"
   147 	;;
   147 	;;
   148 	forget)
   148 	forget)
   149 	    _hg_status "a"
   149 	    _hg_status "a"
   150 	;;
   150 	;;
   151 	diff)
   151 	diff)
   152 	    _hg_status "mra"
   152 	    _hg_status "mar"
   153 	;;
   153 	;;
   154 	revert)
   154 	revert)
   155 	    _hg_status "mra"
   155 	    _hg_status "mard"
   156 	;;
   156 	;;
   157 	clone)
   157 	clone)
   158 	    local count=$(_hg_count_non_option)
   158 	    local count=$(_hg_count_non_option)
   159 	    if [ $count = 1 ]; then
   159 	    if [ $count = 1 ]; then
   160 		_hg_paths
   160 		_hg_paths