Docpie

Latest version: v0.4.2

Safety actively analyzes 629004 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 6

0.3.7

* [fix] [12](https://github.com/TylerTemp/docpie/issues/12) `appearedonly`
not works for empty repeated Options

0.3.6

* [fix] [6](https://github.com/TylerTemp/docpie/issues/6):

for `[a | [b | c] | d]`, docpie could not expand nested `|`. Now it will
be expanded as

a
b
c
d

0.3.5

* [fix] [5](https://github.com/TylerTemp/docpie/issues/5):

for `this | or | that`, docpie will expand

Usage: (--a=<va> | --b=<vb>) --c=<vc>

as

Usage:
--a=<va> --c=<vc>
--b=<vv> --c=<vc>

which two c-s are the same object. if `--c` is matched in first situation but
`--a=<va> --c=<vc>` as a whole fails, `--c` should drop its value.

TODO: use a deep-copy when expand `|`

0.3.4

* [new] BASH tab-completion auto-generate script

0.3.3

* [fix] a logging is not use `docpie` logger
* [fix] sometimes it does not print information when sys.argv is not correct

0.3.2

* [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}

Page 2 of 6

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.