--- a/contrib/bash_completion Sun Oct 22 01:02:06 2006 -0300
+++ b/contrib/bash_completion Sun Oct 22 01:02:13 2006 -0300
@@ -370,6 +370,43 @@
COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$guards' -- "$cur"))
}
+_hg_cmd_qguard()
+{
+ local prefix=''
+
+ if [[ "$cur" == +* ]]; then
+ prefix=+
+ elif [[ "$cur" == -* ]]; then
+ prefix=-
+ fi
+ local ncur=${cur#[-+]}
+
+ if ! [ "$prefix" ]; then
+ _hg_ext_mq_patchlist qseries
+ return
+ fi
+
+ local guards=$(_hg_ext_mq_guards)
+ COMPREPLY=(${COMPREPLY[@]:-} $(compgen -P $prefix -W '$guards' -- "$ncur"))
+}
+
+_hg_opt_qguard()
+{
+ local i
+ for ((i=cmd_index+1; i<=COMP_CWORD; i++)); do
+ if [[ ${COMP_WORDS[i]} != -* ]]; then
+ if [[ ${COMP_WORDS[i-1]} != @($global_args) ]]; then
+ _hg_cmd_qguard
+ return 0
+ fi
+ elif [ "${COMP_WORDS[i]}" = -- ]; then
+ _hg_cmd_qguard
+ return 0
+ fi
+ done
+ return 1
+}
+
# hbisect
_hg_cmd_bisect()