Patchwork [enhancement,2] “hg help …” completion: include “enabled extensions” and “additional help topics”

login
register
mail settings
Submitter Roland Eggner
Date Dec. 31, 2013, 1:43 a.m.
Message ID <20131231014300.GM23913@mobil.systemanalysen.net>
Download mbox | patch
Permalink /patch/3250/
State Superseded
Headers show

Comments

Roland Eggner - Dec. 31, 2013, 1:43 a.m.
# HG changeset patch
# Parent ae2a85c92869b9ea77b81a1cdd256879945e15a0
# User Roland Eggner < odv@systomanalyson.not s/o/e/g >
# Date 1388258172 -3600

“hg help …” completion: include “enabled extensions” and “additional help topics”

v2:  Consider case no extensions enabled at all.

Patch

diff --git a/contrib/bash_completion b/contrib/bash_completion
--- a/contrib/bash_completion
+++ b/contrib/bash_completion
@@ -224,6 +224,10 @@  shopt -s extglob
     case "$cmd" in
 	help)
 	    _hg_commands
+	    COMPREPLY+=( $( compgen -W "$(
+		_hg_cmd help \
+			| sed -nre '/^(enabled extensions|additional help topics):/,/^use "hg -v help" /{s/^ (\w+).*/\1/p;}'
+		)" -- "$cur" ) )
 	;;
 	export)
 	    if _hg_ext_mq_patchlist qapplied && [ "${COMPREPLY[*]}" ]; then