* [fix] options section titles were not set appropriate when options sections's
title was not started with `Options:`
python
"""
Usage: prog [options]
OpTiOnS: -a
Another oPtIoNs: -b
"""
from docpie import Docpie
pie = Docpie(__doc__)
print(list(pie.option_sections)) ['', 'Another']
* [fix] options parse did not parse indent correctly. `example/cp.py` did not work
python
"""
USAGE:
cp [options]
OPTIONS:
-f Descrpition
goes here
"""
from docpie import docpie
print(docpie(__doc__)) should not fail parsing
* [fix] when argv has `--option=arg` but `--option` actually accepts no argument,
raise `ExceptNoArgumentExit` instead of complaining "Unknown option: -arg"
* [new] New `UnknownOptionExit`, `ExceptNoArgumentExit`, `ExpectArgumentExit`,
`ExpectArgumentHitDoubleDashesExit`, `AmbiguousPrefixExit`.
New exception handling way allowing you to customize any output.
See example/customize_output.py for details.
* [fix] when two long options has the same prefix but the shorter one requires argument
but the longer one not, it will try to give a wrong value to it
python
"""
Usage: prog --long=<opt>
prog --long-opt
"""
from docopt import docopt
print(docopt(__doc__, ['prog', '--long-opt']))
before 0.3.2: --long requires argument(s)
now: {'--': False, '--long': None, '--long-opt': True}