Mercurial > hg-stable
changeset 1643:747c8d03bd29
bash_completion: ignore hg help error messages
They are usually not useful when you're completing stuff and end up
cluttering the screen.
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Fri, 27 Jan 2006 12:15:39 +0100 |
parents | b8d792057e5b |
children | e7e6504c4989 |
files | contrib/bash_completion |
diffstat | 1 files changed, 5 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/contrib/bash_completion Fri Jan 27 12:11:14 2006 +0100 +++ b/contrib/bash_completion Fri Jan 27 12:15:39 2006 +0100 @@ -56,7 +56,7 @@ _hg_paths() { - local paths="$(hg paths | sed -e 's/ = .*$//')" + local paths="$(hg paths 2> /dev/null | sed -e 's/ = .*$//')" COMPREPLY=(${COMPREPLY[@]:-} $( compgen -W '$paths' -- "$cur" )) } @@ -70,13 +70,14 @@ _hg_status() { - local files="$( hg status -n$1 . )" + local files="$( hg status -n$1 . 2> /dev/null)" COMPREPLY=(${COMPREPLY[@]:-} $( compgen -W '$files' -- "$cur" )) } _hg_tags() { - local tags="$(hg tags | sed -e 's/[0-9]*:[a-f0-9]\{40\}$//; s/ *$//')" + local tags="$(hg tags 2> /dev/null | + sed -e 's/[0-9]*:[a-f0-9]\{40\}$//; s/ *$//')" COMPREPLY=( ${COMPREPLY[@]:-} $(compgen -W '$tags' -- "$cur") ) } @@ -145,7 +146,7 @@ fi # canonicalize command name - cmd=$(hg -q help "$cmd" | sed -e 's/^hg //; s/ .*//; 1q') + cmd=$(hg -q help "$cmd" 2> /dev/null | sed -e 's/^hg //; s/ .*//; 1q') if [ "$cmd" != status ] && [ "$prev" = -r ] || [ "$prev" = --rev ]; then _hg_tags