nr.cliparser
– Extensible CLI parser.
Work in progress
Example
import nr.cliparser
parser = nr.cliparser.Parser()
parser.argument('-h', nargs=0, help='Show this help.')
parser.argument('script', nargs='?', help='A script to run.')
parser.argument('argv', nargs='...', help='Arguments for the script.')
install = parser.subparser('--install', help='Install a packge.')
install.argument('ref', nargs='?', multiple=True, help='A package reference.')
install.argument('-e', metavar='ref', help='A package reference to install editable.', multiple=True)
install.argument('-g', nargs=0, help='Install globally.')
install.argument('-r', nargs=0, help='Install into root.')
args = parser.parse()
if args['h']:
parser.print_help()
exit()
print(args)
$ python3 example.py -h
usage: example -h [script] ... --install [ [ref] -e <ref> -g -r ]
-h Show this help.
[script] A script to run.
... Arguments for the script. 8-
--install [ ... ] Install a packge.
[ref] A package reference.
-e <ref> A package reference to install editable.
-g Install globally.
-r Install into root.
$ python3 example.py --install -e scope@package
{'install': {'e': ['scope@package'], 'ref': [], 'g': False, 'r': False}, 'h': False, 'script': None, 'argv': []}
Changes
v0.1.1 (2018-09-20)
- Fix Python 2 compatibility
v0.1.0 (2018-09-20)
- Initial release
Metadata
Release files for nr.cliparser 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nr.cliparser-0.1.1.tar.gz | 8.2 kB | Without provenance | Details for nr.cliparser-0.1.1.tar.gz |
Release files / nr.cliparser-0.1.1.tar.gz
| Download URL | nr.cliparser-0.1.1.tar.gz |
|---|---|
| Size | 8.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d51fe87d0ed90947ca81c87b22bb208f4f146163d295ab62f2ecf496963518c9
|
|
BLAKE2b-256 checksum How to use checksums |
776cd545e67365c3d1f5a22e5f68c9b6469b77310c16207118397da8a0e50082
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.4
|
Security for nr.cliparser 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.