=== modified file 'contrib/bash/bzr.simple' --- contrib/bash/bzr.simple 2007-06-06 19:44:39 +0000 +++ contrib/bash/bzr.simple 2008-03-13 19:58:36 +0000 @@ -6,7 +6,12 @@ _bzr_commands() { - bzr help commands | sed -r 's/^([-[:alnum:]]*).*/\1/' | grep '^[[:alnum:]]' + bzr help commands | grep -o '^[[:alnum:]]\+' +} + +_bzr_help_topics() +{ + bzr help topics | grep -o '^[[:alnum:]]\+' } _bzr() @@ -14,11 +19,17 @@ cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} if [ $COMP_CWORD -eq 1 ]; then - COMPREPLY=( $( compgen -W "$(_bzr_commands)" $cur ) ) + if [ -z "$__bzr_commands_comp_cached" ]; then + __bzr_commands_comp_cached="$(_bzr_commands)" + fi + COMPREPLY=( $( compgen -W "$__bzr_commands_comp_cached" $cur ) ) elif [ $COMP_CWORD -eq 2 ]; then case "$prev" in help) - COMPREPLY=( $( compgen -W "$(_bzr_commands) commands" $cur ) ) + if [ -z "$__bzr_help_comp_cached" ]; then + __bzr_help_comp_cached="$(_bzr_commands) $(_bzr_help_topics) commands" + fi + COMPREPLY=( $( compgen -W "$__bzr_help_comp_cached" $cur ) ) ;; esac fi