Mercurial > hg > mercurial-crew-with-dirclash
comparison contrib/bash_completion @ 3475:03932425cfd8
bash_completion: don't complete export with "garbage" when mq is not around
The "garbage" is the output of hg help printed when a command is not found.
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Sun, 22 Oct 2006 01:01:03 -0300 |
parents | c995d68333cf |
children | 13a9a2136dd7 |
comparison
equal
deleted
inserted
replaced
3474:bbfb392b2b1a | 3475:03932425cfd8 |
---|---|
249 # Completion for commands provided by extensions | 249 # Completion for commands provided by extensions |
250 | 250 |
251 # mq | 251 # mq |
252 _hg_ext_mq_patchlist() | 252 _hg_ext_mq_patchlist() |
253 { | 253 { |
254 local patches=$("$hg" $1 2>/dev/null) | 254 local patches |
255 COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$patches' -- "$cur")) | 255 patches=$("$hg" $1 2>/dev/null) |
256 if [ $? -eq 0 ] && [ "$patches" ]; then | |
257 COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$patches' -- "$cur")) | |
258 return 0 | |
259 fi | |
260 return 1 | |
256 } | 261 } |
257 | 262 |
258 _hg_ext_mq_queues() | 263 _hg_ext_mq_queues() |
259 { | 264 { |
260 local root=$("$hg" root 2>/dev/null) | 265 local root=$("$hg" root 2>/dev/null) |