[PATCH]: Optional explanation for options

Robert Collins robertc at robertcollins.net
Wed Sep 7 16:49:19 BST 2005


On Wed, 2005-09-07 at 16:00 +0200, Jan Hudec wrote:
> On Wed, Sep 07, 2005 at 21:31:58 +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?
> 
> It does not need to vary to be useful. It allows the whole help to be
> introspectible, so shell completition can print relevant parts (at least zsh
> can do it).

Good, in which case, I think we should put the description on the
options and argument definitions, NOT on the commands.

i.e. in the command
takes_options = ['revision']

...
OPTIONS
'revision' = (revid, 'A specific revision')

Rob

-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050908/d3c1233e/attachment.pgp 


More information about the bazaar mailing list