commandparse
Module to parse command based CLI application.
Usage:
- Subclass the Command class
- Add a method with a name such as
prefix_commandnamewith kwargs as required argument - Create an ArgumentParser instance
- Call the
Subclass.add_suparserswith the ArgumentParser instance and other settings - Use the
dispatch_commandfunction with the args returned byparser.parse_args()
parser = ArgumentParser(...)
[...]
Subclass.add_subparsers(parser, prefixes=["get_", "do_", ...], title="commands", description="available commands")
cmd = Subclass(...)
cmd.dispatch_command(commands, args)
See example.py for a more complete example. For a real world application using this lib, see: https://github.com/franc-pentest/ldeep
Release files for commandparse 1.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| commandparse-1.1.2.tar.gz | 5.4 kB | Details |
Release files / commandparse-1.1.2.tar.gz
| Download URL | commandparse-1.1.2.tar.gz |
|---|---|
| Size | 5.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4bd7bdd01b52eaa32316d6149a00b4c3820a40ff2ad62476b46aaae65dbe9faa
|
|
BLAKE2b-256 checksum How to use checksums |
796b6f1879101e405e2a5c7d352b340bc97d1936f8d54a8934ae32aac1828e50
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.2
|