[PATCH 2 of 2] pager: add global --paginate/--no-pager options

Brodie Rao brodie at bitheap.org
Fri Aug 27 19:17:32 CDT 2010


On Aug 27, 2010, at 7:28 PM, Martin Geisler wrote:

> Augie Fackler <durin42 at gmail.com> writes:
>
>> On Aug 22, 2010, at 11:24 AM, Brodie Rao wrote:
>>
>>> I thought about that, but most programs that provide a --pager flag
>>> require to have an argument with the pager you want to use (e.g.,
>>> --pager='less -foo -bar...'). Git has both --paginate and --no-pager
>>> that work the same way as in this patch.
>>>
>>> I'm not opposed to making it --pager, though I think I'd rather it  
>>> be
>>> --pager=<off,on,auto>. It wouldn't be consistent with --color but
>>> it'd be less to type.
>>
>> Perhaps it could be --paginate=<off,never,on,always,auto> and leave
>> the --pager flag free for changing the pager if desired? Or we could
>> just assume people won't have a pager named one of those 5 things and
>> overload the meaning, but that feels nasty to me somehow.
>>
>> Any objection if I whip up a patch to let color take all 5 of those
>> options for the --color flag?
>
> I've also been annoyed by the --color flag... I mostly think of it  
> as a
> boolean, so I expect 0/1, false/true, no/yes to work. That is also has
> those funny never/always values is confusing, not to mention the third
> state (auto).

I think not mentioning it in command help would be fine, but it'd be  
nice to mention all possible option values in the extension help.

> So making it accept the normal values we recognize for booleans  
> would be
> a step forward. I actually think we could remove the 'auto' value and
> keep that purely internal: let unset mean 'auto' and let the user
> override with true/false as needed.

Sounds good.

FWIW, I modeled the option after GNU grep:

       --color[=WHEN],
       --colour[=WHEN]       use markers to highlight the matching  
strings;
                             WHEN is `always', `never', or `auto'


More information about the Mercurial-devel mailing list