On 2009-08-12, grubert@... wrote:
> On Sat, 8 Aug 2009, Guenter Milde wrote:
For some boolean option pairs (--some-feature --no-some-feature)
>> ... the corresponding enabling/disabling option is missing, which
>> becomes problematic if the default setting is changed in a config
>> Instead of providing option pairs for all boolean settings, I would like
>> to introduce support boolean command line arguments, i.e.
>> --some-feature=True --some-feature=False
>> (which should accept the same set of values as the config file).
> Sounds reasonable.
Unfortunately, there is no straigthforward support for a
backwards-compatible solution with optional argument (accepting both
``--some-feature`` and ``--some-feature=True``). The optparse docs say:
Typically, a given option either takes an argument or it doesn\u2019t.
Lots of people want an \u201coptional option arguments\u201d feature,
meaning that some options will take an argument if they see it, and
won\u2019t if they don\u2019t. This is somewhat controversial, because
it makes parsing ambiguous: if "-a" takes an optional argument and
"-b" is another option entirely, how do we interpret "-ab"? Because of
this ambiguity, optparse does not support this feature.
So I am not sure whether its better to
a) add missing "partner options", or
b) introduce boolean arguments
> I lately had two problems with this:
> * section-numbering only works when activated in the document
> not from commandline
This is a feature, it must be *enabled* via command-line/config-file and
*activated* in the document.