bashcompletion: show available command-line switches for aliases
authorMartijn Pieters <mjpieters@fb.com>
Tue, 21 Jun 2016 17:15:51 +0100
changeset 29386 63fad6235369
parent 29385 aa1d56003872
child 29387 6b77adc2c7b5
bashcompletion: show available command-line switches for aliases When auto-completing hg commands, aliases are listed, but not the available switches for an alias, because `HGPLAIN=1` filters these out. Add a `HGPLAINEXCEPT=alias` exception to resolve this. We make heavy use of aliases that drive hg log with custom revsets, sorting and the -G switch, but want our users to be able to auto-complete any additional command-line switches.
contrib/bash_completion
--- a/contrib/bash_completion	Mon Jun 20 23:31:45 2016 +0530
+++ b/contrib/bash_completion	Tue Jun 21 17:15:51 2016 +0100
@@ -184,7 +184,7 @@
             return
         fi
 
-        opts=$(_hg_cmd debugcomplete --options "$cmd")
+        opts=$(HGPLAINEXCEPT=alias _hg_cmd debugcomplete --options "$cmd")
 
         COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$opts' -- "$cur"))
         _hg_fix_wordlist