Docpie

Latest version: v0.4.2

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

Scan your dependencies

Page 3 of 6

0.3.1

* [new] Add `namedoptions` feature. [Document](https://github.com/TylerTemp/docpie/wiki/Advanced-APIsnamedoptions)

0.3.0

* [fix] can't parse options expecting arguments in usage
correctly, due to a previous code changing

"""
Usage: prog [options] --color <COLOR>

Options:
--color=<COLOR>
"""
from docpie import docpie
print(docpie(__doc__), ['prog', '--color', 'red'])
{'--': False, '--color': 'red'}

0.2.9

* [fix] `optionsfirst` can work as expected (previously it can not recognize the
expected arguments of a option and lead to fail):

"""
Usage: prog [options] -w<val> <arg>
"""
from docpie import docpie
print(docpie(__doc__), ['prog', '-w', 'sth', 'arg'], optionsfirst=True)
{'--': False, '-w': 'sth', '<arg>': 'arg'}

0.2.8

* [fix] the following situation will not failed now (note: not recommended, not POSIX standard)

"""
Usage: prog [options] <arg>

Options:
--force[=<value>]
"""

from docpie import docpie
docpie(__doc__, ['prog', '--force', '--', 'val'])
{'--': True, '--force': None, '<arg>': 'val'}

0.2.7

* [fix] a typo which will cause failed to throw an error when there is
an syntax error in your help message
* \[fix\] [issue 3](https://github.com/TylerTemp/docpie/issues/3)

0.2.6

* [new] Now repeatable arguments have a better handling way.

First, the repeatable elements can be more than one argument,
and can be nested. But can only be argument (not option, not
command)


(<arg1> <arg2>)... <arg3>


Second, the elements after repeatable arguments can be argument
and command, and can be groupd


<arg>... <arg2> cmd
<arg>... (cmd <arg2>) <arg3>

Page 3 of 6

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.