# HG changeset patch # User Alexis S. L. Carvalho # Date 1125340627 -7200 # Node ID ff560ce0c635429cf395d46c5c2150889385ec8d # Parent 10b4f2a5ce17fe88152327d127f416d1292779d4 bash_completion: small cleanup and bugfix _hg_count_non_option wasn't taking global options into account while counting non-option arguments. It also used only its first argument. diff -r 10b4f2a5ce17 -r ff560ce0c635 contrib/bash_completion --- a/contrib/bash_completion Mon Aug 29 20:37:07 2005 +0200 +++ b/contrib/bash_completion Mon Aug 29 20:37:07 2005 +0200 @@ -41,11 +41,9 @@ for (( i=1; $i<=$COMP_CWORD; i++ )); do if [[ "${COMP_WORDS[i]}" != -* ]]; then - for f in $filters; do - if [[ ${COMP_WORDS[i-1]} == $f ]]; then - continue 2 - fi - done + if [[ ${COMP_WORDS[i-1]} == @($filters|$global_args) ]]; then + continue + fi count=$(($count + 1)) fi done @@ -154,7 +152,7 @@ COMPREPLY=(${COMPREPLY[@]:-} $( compgen -f -X "!*.d" -- "$cur" )) ;; cat) - local count=$(_hg_count_non_option -o --output) + local count=$(_hg_count_non_option '-o|--output') if [ $count = 2 ]; then _hg_tags else