[MERGE] RegistryOption

Martin Pool mbp at canonical.com
Wed Jan 10 01:37:01 GMT 2007


On  9 Jan 2007, Aaron Bentley <aaron.bentley at utoronto.ca> wrote:
> Martin Pool wrote:
> > + RegistryOption('format',
> > help='Specify a format for this branch. Current'
> >  ' formats are: default, knit, metaweave and' ' weave. Default is knit;
> > metaweave and' ' weave are deprecated',
> > 
> > It would be nice if the list of possible values was generated
> > automatically (maybe into a separate field from the regular help)
> 
> Yes.  I wasn't sure how to go about this.  All the help is already
> provided by the switches:
> 
>   --format=ARG          Specify a format for this branch. Current
> formats are:                        default, knit, metaweave and weave.
> Default is knit;
>                         metaweave and weave are deprecated
>   --default             Format using knits.  Recommended.
>   --experimental-knit2  Experimental successor to knit.  Use at your own
> risk.  --knit                Format using knits.  Recommended.
>   --metaweave           Transitional format in 0.8.  Slower than knit.
>   --weave               Pre-0.8 format.  Slower than knit and does not
> support                        checkouts or shared repositories.
> 
> So if we show that, we could potentially be repeating a lot of text.  We
> also have the "bzr help formats" display, which displays the same
> information, somewhat differently.
> 
> Here are some possible approaches:
> - Show possible values all the time
> - Only show possible values when value_switches is false
> - Provide "see also: bzr help formats"
> 
> Do any of these sound good?  Do you have another idea?

How about having the option declared with 

  RegistryOption('format', ....
       help_topics=['formats'])

Then when showing the help for a command, we collect all the help topics
referenced by all options, and print them in a 'see also' line at the
bottom.

-- 
Martin



More information about the bazaar mailing list