[RFC] use optparse for option handling
Aaron Bentley
aaron.bentley at utoronto.ca
Fri Jul 14 03:38:25 BST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
John Arbash Meinel wrote:
> I think you want 'store_false' not 'store_const'. I think by doing
> 'store_const' it is using the default 'const=None', so you get None
> back, not False.
Normally, yes, but there are bits of the codebase that misbehave if the
value exists but is set to False. This way imitates the way the system
currently works most closely. Naturally, I'd prefer to fix the code
that's misbehaving when the value's set to False.
>>> I was assuming all booleans should be negatable. Is that wrong?
>
> Having it consistent is reasonable. It does mean we will have some weird
> coupling, but it makes it easier for scripting front ends.
What do you mean by 'weird coupling'?
>>>>> it's probably good to show both in the help.
>>> Okay, so that means we won't want to use optparse to generate our option
>>> help, because it wants help for every flag name, and we don't provide
>>> text for the inverted help.
>
> Actually, just add the inverted option first. Then you get:
>
> --other-option help on other-option
> --no-foo
> --foo help on foo
>
> I do that all the time.
Okay, that's an option. I was thinking more like:
- --other-option help on other-option
- --foo, --no-foo help on foo
Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFEtwOh0F+nu1YWqI0RAqf5AJ4//3LU9QGRsGVs30lPwyDYKJUO6QCcDTuT
3EfPDjj0hhhGF3htmC2HPRo=
=k86G
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list