bash_completion: add debugindex and debugdata support
authormpm@selenic.com
Sat, 27 Aug 2005 20:42:53 -0700
changeset 1115 89f54e72581d
parent 1114 58371c4c2c8f
child 1116 0cdd73b0767c
bash_completion: add debugindex and debugdata support
contrib/bash_completion
--- a/contrib/bash_completion	Sat Aug 27 19:15:02 2005 -0700
+++ b/contrib/bash_completion	Sat Aug 27 20:42:53 2005 -0700
@@ -1,3 +1,5 @@
+#!/bin/bash
+
 _hg_commands()
 {
     local commands="$(hg -v help | sed -e '1,/^list of commands:/d' \
@@ -8,7 +10,7 @@
     # specifically asked for
     if [[ "$cur" == de* ]]; then
 	commands="$commands debugcheckstate debugstate debugindex"
-	commands="$commands debugindexdot debugwalk"
+	commands="$commands debugindexdot debugwalk debugdata"
     fi
     COMPREPLY=( ${COMPREPLY[@]:-} $(compgen -W "$commands" -- "$cur") )
 }
@@ -135,6 +137,12 @@
 	    fi
 	    COMPREPLY=(${COMPREPLY[@]:-} $( compgen -d -- "$cur" ))
 	;;
+	debugindex|debugindexdot)
+	    COMPREPLY=(${COMPREPLY[@]:-} $( compgen -f -X "!*.i" -- "$cur" ))
+	;;
+	debugdata)
+	    COMPREPLY=(${COMPREPLY[@]:-} $( compgen -f -X "!*.d" -- "$cur" ))
+	;;
 	cat)
 	    local count=$(_hg_count_non_option -o --output)
 	    if [ $count = 2 ]; then