[PATCH] pager: add 'help' to default attended commands

Brodie Rao brodie at bitheap.org
Sat Apr 30 11:48:48 CDT 2011


On Apr 30, 2011, at 4:48 PM, Idan Kamara wrote:

> I initially wanted `hg <cmd> --help` to open the pager too but  
> apparently when dispatch:runcommand sees --help (and --version too  
> it seems),
> it calls the help command directly rather than going through the  
> possibly wrapped _runcommand, bypassing extensions.
>
> I couldn't think of an elegant solution to fix that, other than  
> looking for --help in the args and modifying them in place which  
> feels hackish to me.

I don't think it's worth doing this if we can't get consistent behavior.

If you make dispatch do another dispatch call to the help command when  
it sees --help, that might solve this problem.

> # HG changeset patch
> # User Idan Kamara <idankk86 at gmail.com>
> # Date 1304173030 -10800
> # Node ID 748010ab96adf1515bdf379713045fed957c4e8f
> # Parent  a94aef11f2ef37ee02c4a5c263c3a706de6f1d1e
> pager: add 'help' to default attended commands
>
> diff -r a94aef11f2ef -r 748010ab96ad hgext/pager.py
> --- a/hgext/pager.py    Sat Apr 30 15:43:19 2011 +0300
> +++ b/hgext/pager.py    Sat Apr 30 17:17:10 2011 +0300
> @@ -113,4 +113,4 @@
>          _("when to paginate (boolean, always, auto, or never)"),
>          _('TYPE')))
>
> -attended = ['annotate', 'cat', 'diff', 'export', 'glog', 'log',  
> 'qdiff']
> +attended = ['annotate', 'cat', 'diff', 'export', 'glog', 'help',  
> 'log', 'qdiff']
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel



More information about the Mercurial-devel mailing list