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

login
register
mail settings
Submitter Roland Eggner
Date Dec. 30, 2013, 7:12 p.m.
Message ID <20131230191233.GE23913@mobil.systemanalysen.net>
Download mbox | patch
Permalink /patch/3244/
State Superseded
Headers show

Comments

Roland Eggner - Dec. 30, 2013, 7:12 p.m.
# HG changeset patch
# Parent c841ed025667e42bd297e50b8db2e0ddf2c8af67
# User Roland Eggner < odv@systomanalyson.not s/o/e/g >
# Date 1388258172 -3600

[enhancement 2] “hg help …” completion.  Include “enabled extensions” and “additional help topics”.

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:/,/^use "hg -v help" /{s/^ (\w+).*/\1/p;}'
+		)" -- "$cur" ) )
 	;;
 	export)
 	    if _hg_ext_mq_patchlist qapplied && [ "${COMPREPLY[*]}" ]; then