# HG changeset patch # User Alexis S. L. Carvalho # Date 2005-08-29 18:37:07 # Node ID f82b084bd904b46ce06248852dd3be09ff2f5360 # Parent fad2d091c74f06c33125376a3fdcd2ec2ccf6776 bash_completion: update for new help output format diff --git a/contrib/bash_completion b/contrib/bash_completion --- a/contrib/bash_completion +++ b/contrib/bash_completion @@ -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