[PATCH] show value requirement and multiple occurrence of option in online help

Martin Geisler mg at aragost.com
Mon May 17 02:23:19 CDT 2010


Matt Mackall <mpm at selenic.com> writes:

> On Sun, 2010-05-16 at 20:10 +0900, FUJIWARA Katsunori wrote:
>> # HG changeset patch
>> # User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
>> # Date 1274007852 -32400
>> # Node ID 46ffed62714f9396e658c822b13da1062cf350e3
>> # Parent  6e65b451b62e6b5bf57e5df34e56214c78e762d6
>> show value requirement and multiple occurrence of option in online help
>> 
>> this helps users to know what kind of option is:
>> 
>>   - no value is required(flag option)
>>   - value is required
>>   - value is required, multiple occurrences of this option are additive
>> 
>> each kinds are shown as below:
>> 
>>   -f --force          force push
>>   -e --ssh VALUE      specify ssh command to use
>>   -r --rev VALUE [+]  a specific revision up to which you would like to push
>
>> +    if multioccur:
>> +        msg = _("\n[+] multiple occurrences of this option are additive")
>
> I don't know if they're always "additive".

Perhaps the word "accumulate" is better. Or simply "this option can be
specified multiple times".

>> + -r --rev VALUE          import up to target revision REV
>
> This is a little sad. We have VALUE on the left and REV on the right
> and in the summary. Seems like we should add an optional fourth
> element to our option tuple.

I think that is a good idea -- the optparse library also takes a metavar
argument variable when declaring options for this purpose.

-- 
Martin Geisler

aragost Trifork
Professional Mercurial support
http://aragost.com/mercurial/


More information about the Mercurial-devel mailing list