[PATCH]: Optional explanation for options

Magnus Therning magnus at therning.org
Wed Sep 7 20:20:58 BST 2005


On Wed, Sep 07, 2005 at 09:31:58PM +1000, Robert Collins wrote:
>On Wed, 2005-09-07 at 09:04 +0100, Magnus Therning wrote:
>> The following patch makes it possible to add explanations to options for
>> commands. E.g.
>> 
>> class cmd_my_command(Command):
>>     ...
>>     takes_options = [('revision', 'Retrieve particular revision')]
>>     ...
>> 
>> I think it'd be handy for command line completion...
>
>So, we have the ability at the moment to introspect to determine
>argument and option types. Do you think that adding the explanation to
>the list of OPTIONS and ARGUMENTS globally would be reasonable? I mean
>- does the intent vary without the type varying?

I think they vary, e.g. --revision can be a single revision or a
sequence. Some commands expect a single revision only others can handle
single and sequences. 'branch' falls in the former category while 'log'
falls in the latter.

/M

-- 
Magnus Therning                    (OpenPGP: 0xAB4DFBA4)
magnus at therning.org
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

The multiple human needs and desires that demand privacy among two or
more people in the midst of social life must inevitably lead to
cryptology wherever men thrive and wherever they write.
      -- David Kahn, _The Codebreakers_
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050907/80b58afb/attachment.pgp 


More information about the bazaar mailing list