Mercurial > hg
changeset 1149:f82b084bd904
bash_completion: update for new help output format
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Mon, 29 Aug 2005 20:37:07 +0200 |
parents | fad2d091c74f |
children | 4ee09418c8e5 |
files | contrib/bash_completion |
diffstat | 1 files changed, 2 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/contrib/bash_completion Mon Aug 29 11:28:48 2005 -0700 +++ b/contrib/bash_completion Mon Aug 29 20:37:07 2005 +0200 @@ -73,11 +73,8 @@ done if [[ "$cur" == -* ]]; then - opts="$(hg -v help | sed -e '1,/^global options/d; /^ -/!d')" - - if [ -n "$cmd" ]; then - opts="$opts $(hg help "$cmd" | sed -e '/^ -/!d; s/ [^-][^ ]*//')" - fi + # this assumes that there are no commands with spaces in the name + opts=$(hg -v help $cmd | sed -e '/^ *-/!d; s/ [^- ].*//') COMPREPLY=( ${COMPREPLY[@]:-} $(compgen -W "$opts" -- "$cur") ) return