Message169712
| Author |
Christophe.Guillon |
| Recipients |
Christophe.Guillon, amcnabb, andersk, bethard, davidben, drm, eric.araujo, eric.smith, gdb, nelhage, r.david.murray, skilletaudio |
| Date |
2012年09月02日.17:58:44 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1346608725.55.0.443462171772.issue9334@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
As a workaround for this missing feature,
the negative number matching regexp can be used for allowing arguments starting with '-' in arguments of option flags.
We basically do:
parser = argparse.ArgumentParser(...)
parser._negative_number_matcher = re.compile(r'^-.+$')
This allow cases such as @andersk:
$ a2x --asciidoc-opts --safe gitcli.txt
where '--safe' is an argument to '--asciidoc-opts'
As this behavioral change is quite simple, couldn't the requested feature be implemented like this with an optional setting to the ArgumentParser contructor? |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年09月02日 17:58:45 | Christophe.Guillon | set | recipients:
+ Christophe.Guillon, amcnabb, bethard, eric.smith, eric.araujo, r.david.murray, andersk, gdb, nelhage, drm, davidben, skilletaudio |
| 2012年09月02日 17:58:45 | Christophe.Guillon | set | messageid: <1346608725.55.0.443462171772.issue9334@psf.upfronthosting.co.za> |
| 2012年09月02日 17:58:45 | Christophe.Guillon | link | issue9334 messages |
| 2012年09月02日 17:58:44 | Christophe.Guillon | create |
|