contrib/bash_completion
changeset 2034 5e7aff1b6ae1
parent 1888 283d2ab1e020
child 2035 107dc72880f8
--- a/contrib/bash_completion	Sat Apr 01 21:37:08 2006 +0200
+++ b/contrib/bash_completion	Sat Apr 01 22:50:12 2006 +0200
@@ -1,18 +1,5 @@
 shopt -s extglob
 
-_hg_option_list()
-{
-    "$hg" -v help $1 2>/dev/null | \
-	awk '/^ *-/ {
-		for (i = 1; i <= NF; i ++) {
-		    if (index($i, "-") != 1)
-			break;
-		    print $i;
-		}
-	    }'
-}
-
-
 _hg_commands()
 {
     local commands
@@ -89,7 +76,7 @@
     done
 
     if [[ "$cur" == -* ]]; then
-	opts=$(_hg_option_list $cmd)
+	opts=$("$hg" debugcomplete --options "$cmd" 2>/dev/null)
 
 	COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$opts' -- "$cur"))
 	return