Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sean2077/auto-usage
A python tool for auto-generating usage for python cli tools.
https://github.com/sean2077/auto-usage
autogenerate python-cli usage
Last synced: about 1 month ago
JSON representation
A python tool for auto-generating usage for python cli tools.
- Host: GitHub
- URL: https://github.com/sean2077/auto-usage
- Owner: sean2077
- Created: 2021-05-19T05:27:52.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-05-20T10:10:42.000Z (over 3 years ago)
- Last Synced: 2024-08-10T09:33:55.508Z (4 months ago)
- Topics: autogenerate, python-cli, usage
- Language: Python
- Homepage:
- Size: 12.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
- [Auto Usage](#auto-usage)
- [Installation](#installation)
- [How to use](#how-to-use)
- [Usage](#usage)
- [subcommand: quickstart](#subcommand-quickstart)# Auto Usage
A python tool for auto-generating or auto-updating usage of python cli tools.
> Note: This project was created with [Cookiecutter](https://github.com/cookiecutter/cookiecutter) and the [`zhangxianbing/cookiecutter-pypackage`](https://github.com/zhangxianbing/cookiecutter-pypackage) project template.
## Installation
```bash
# install
pip install auto-usage# usage
cd /path/to/project
auto-usage
```## How to use
Auto-usage works for python cli tools based on [argparse](https://docs.python.org/3/library/argparse.html), [click](https://github.com/pallets/click) or other scripts that support '--help' option for showing help message like the following [usage](#Usage).
For auto-usage using regex pattern `^[uU]sage: ` to search where the usage beginning, and using `^[cC]ommands:\s*$` to search where the subcommands beginning, you must make sure your tool's usage following the pattern.
As for project structure, you can refer to this project, or just created with [Cookiecutter](https://github.com/cookiecutter/cookiecutter) and the [`zhangxianbing/cookiecutter-pypackage`](https://github.com/zhangxianbing/cookiecutter-pypackage) project template.
## Usage
```
usage: auto-usage [-h] [-V] [-c COMMAND] ...A python tool for auto-generating or auto-updating usage of python cli tools.
optional arguments:
-h, --help show this help message and exit
-V, --version show program's version number and exit
-c COMMAND, --command COMMAND
main command, default is "python -m auto_usage"Commands:
quickstart quickstart for auto-usage.```
### subcommand: quickstart
```
usage: auto-usage quickstart [-h]optional arguments:
-h, --help show this help message and exit```
> Note: This usage is auto-generated by [zhangxianbing/auto-usage](https://github.com/zhangxianbing/auto-usage).