contrib/zsh_completion
changeset 3559 35b99f076d02
parent 3558 733835602365
child 3560 6106236bc4eb
equal deleted inserted replaced
3558:733835602365 3559:35b99f076d02
   502 }
   502 }
   503 
   503 
   504 # MQ
   504 # MQ
   505 _hg_qseries() {
   505 _hg_qseries() {
   506   typeset -a patches
   506   typeset -a patches
   507   patches=($(_hg_cmd qseries))
   507   patches=($(_hg_cmd qseries 2>/dev/null))
   508   (( $#patches )) && _describe -t hg-patches 'patches' patches
   508   (( $#patches )) && _describe -t hg-patches 'patches' patches
   509 }
   509 }
   510 
   510 
   511 _hg_qapplied() {
   511 _hg_qapplied() {
   512   typeset -a patches
   512   typeset -a patches
   513   patches=($(_hg_cmd qapplied))
   513   patches=($(_hg_cmd qapplied 2>/dev/null))
   514   if (( $#patches ))
   514   if (( $#patches ))
   515   then
   515   then
   516     patches+=(qbase qtip)
   516     patches+=(qbase qtip)
   517     _describe -t hg-applied-patches 'applied patches' patches
   517     _describe -t hg-applied-patches 'applied patches' patches
   518   fi
   518   fi
   519 }
   519 }
   520 
   520 
   521 _hg_qunapplied() {
   521 _hg_qunapplied() {
   522   typeset -a patches
   522   typeset -a patches
   523   patches=($(_hg_cmd qunapplied))
   523   patches=($(_hg_cmd qunapplied 2>/dev/null))
   524   (( $#patches )) && _describe -t hg-unapplied-patches 'unapplied patches' patches
   524   (( $#patches )) && _describe -t hg-unapplied-patches 'unapplied patches' patches
   525 }
   525 }
   526 
   526 
   527 _hg_qguards() {
   527 _hg_qguards() {
   528   typeset -a guards
   528   typeset -a guards
   529   local guard
   529   local guard
   530   compset -P "+|-"
   530   compset -P "+|-"
   531   _hg_cmd qselect -s | while read guard
   531   _hg_cmd qselect -s 2>/dev/null | while read guard
   532   do
   532   do
   533     guards+=(${guard#(+|-)})
   533     guards+=(${guard#(+|-)})
   534   done
   534   done
   535   (( $#guards )) && _describe -t hg-guards 'guards' guards
   535   (( $#guards )) && _describe -t hg-guards 'guards' guards
   536 }
   536 }