[PATCH 1 of 5] bash_completion: update for new help output format

Alexis S. L. Carvalho alexis at cecm.usp.br
Sun Aug 28 20:43:13 CDT 2005


# HG changeset patch
# User Alexis S. L. Carvalho <alexis at cecm.usp.br>
# Node ID 383b1cafbc1dfeea248bbd095a283c39329b6858
# Parent  a33a7a543803c7383a6918b19797bf9fd6b83e8e
bash_completion: update for new help output format

diff -r a33a7a543803 -r 383b1cafbc1d contrib/bash_completion
--- a/contrib/bash_completion	Sun Aug 28 06:45:27 2005
+++ b/contrib/bash_completion	Mon Aug 29 01:12:05 2005
@@ -73,11 +73,8 @@
     done
 
     if [[ "$cur" == -* ]]; then
-	opts="$(hg -v help | sed -e '1,/^global options/d; /^ -/!d')"
-
-	if [ -n "$cmd" ]; then
-	    opts="$opts $(hg help "$cmd" | sed -e '/^ -/!d; s/ [^-][^ ]*//')"
-	fi
+	# this assumes that there are no commands with spaces in the name
+	opts=$(hg -v help $cmd | sed -e '/^ *-/!d; s/ [^- ].*//')
 
 	COMPREPLY=( ${COMPREPLY[@]:-} $(compgen -W "$opts" -- "$cur") )
 	return


More information about the Mercurial mailing list