RegistryOption does not show possible values with value_switches=False

John Arbash Meinel john at arbash-meinel.com
Fri Oct 26 16:54:54 BST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Aaron Bentley wrote:
> Adeodato Simó wrote:
>> Hello.
> 
>> I just noticed that if I create a RegistryOption with value_switches=False, 
>> the help output for the command does not include a list of possible values
>> for the option. Is this intentional?
> 
> Yes.
> 

Just to clarify... My understanding of value_switches was that it allows you to
do "--knit" rather than having to type "--format=knit".

So when you set value_switches=True, it is very easy to add the documentation
for each value. Because optparse gives you a quick an easy place to set "help=XXX".

However, it would be nice if you set "value_switches=False" for it to include
the documentation inside the help for "format" automatically.
To use bzr init as an example. Right now with value_switches = True we see:

  Branch Format:
    --format=ARG        Specify a format for this branch. See "help
                        formats".
    --default           New in 0.15: Fast local operations and improved
                        scaling for network operations. Additionally
                        adds support for tags. Incompatible with bzr <
                        0.15.
    --dirstate          New in 0.15: Fast local operations. Compatible
                        with bzr 0.8 and above when accessed over the
                        network.
    --dirstate-tags     New in 0.15: Fast local operations and improved
                        scaling for network operations. Additionally
                        adds support for tags. Incompatible with bzr <
                        0.15.


What I think would be nice, is if value_switches=False, we would get:

  Branch Format:
    --format=ARG        Specify a format for this branch. See "help
                        formats".
    			default		New in 0.15: Fast local operations
                                        and improved scaling for network
                                        operations.  Additionally adds
                                        support for tags. Incompatible
                                        with bzr < 0.15.
                        dirstate        New in 0.15: Fast local operations.
                                        Compatible with bzr 0.8 and
                                        above when accessed over the
                                        network.
                        dirstate-tags   New in 0.15: Fast local
                                        operations and improved scaling
                                        for network operations.
                                        Additionally adds support for
                                        tags.  Incompatible with bzr <
                                        0.15.

I apologize for the tight wrapping, as 72 characters (for an email) is not a
lot. I suppose we could also write it as:
  Branch Format:
    --format=ARG        Specify a format for this branch. See "help
                        formats".
    			default
                            New in 0.15: Fast local operations and
                            improved scaling for network operations.
                            Additionally adds support for tags.
                            Incompatible with bzr < 0.15.
                        dirstate
                            New in 0.15: Fast local operations.
                            Compatible with bzr 0.8 and above when
                            accessed over the network.
                        dirstate-tags
                            New in 0.15: Fast local operations and
                            improved scaling for network operations.
                            Additionally adds support for tags.
                            Incompatible with bzr < 0.15.


Either way, I think it would be nice if the options were auto documenting.
Irrespective of what value_switches was set to.


Or is there a specific reason why you want value_switches=False to deactivate
automatic documentation? If you really want that, it seems like having a
separate: autodoc=False flag would be better.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHIg3OJdeBCYSNAAMRAthbAJwJXYSn539yWViSsgRoxHFdwnZLMgCcC9tC
y6jrRSAYXC4cJh6BtfSSy04=
=rleK
-----END PGP SIGNATURE-----



More information about the bazaar mailing list