cloup
Adds option groups to pallets/click.
This package only affects how the command help is formatted, it doesn’t (and never will) allow to specify constraints on option groups. Look at click-option-group if you want that.
Free software: MIT license
Example
The following code
import click
import cloup
from cloup import option_group, option
@cloup.command('clouptest')
@click.argument('arg')
@option_group('Option group A', [
option('--a1', help='1st option of group A'),
option('--a2', help='2nd option of group A'),
option('--a3', help='3rd option of group A')],
help='This is a useful description of group A',
)
@option_group('Option group B', [
option('--b1', help='1st option of group B'),
option('--b2', help='2nd option of group B'),
option('--b3', help='3rd option of group B'),
])
@option('--opt1', help='an uncategorized option')
@option('--opt2', help='another uncategorized option')
def cli(**kwargs):
""" A CLI that does nothing. """
print(kwargs)
… will print:
Usage: clouptest [OPTIONS] [ARG] A CLI that does nothing. Option group A: This is a useful description of group A --a1 TEXT 1st option of group A --a2 TEXT 2nd option of group A --a3 TEXT 3rd option of group A Option group B: --b1 TEXT 1st option of group B --b2 TEXT 2nd option of group B --b3 TEXT 3rd option of group B Other options: --opt1 TEXT an uncategorized option --opt2 TEXT another uncategorized option --help Show this message and exit.
Credits
I started from the code written by @chrisjsewell in this comment.
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
0.1.0 (2020-02-25)
First release on PyPI.
Metadata
Release files for cloup 0.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 | |
|---|---|---|---|
| cloup-0.1.2.tar.gz | 11.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cloup-0.1.2-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 16.3 kB
Release files / cloup-0.1.2.tar.gz
| Download URL | cloup-0.1.2.tar.gz |
|---|---|
| Size | 11.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5b107bd821bf39cc4156cb9362ef39d92ef0528a781a5d045609b676cea4bff8
|
|
BLAKE2b-256 checksum How to use checksums |
4eca6875cf2c7301471316149cf08fc4c410c48678b8b82560707a0f27b03cba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.0
|
Release files / cloup-0.1.2-py2.py3-none-any.whl
| Download URL | cloup-0.1.2-py2.py3-none-any.whl |
|---|---|
| Size | 5.1 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
0ed390af49c2a2a19ada9ca654f22705ed83b25413a55656d16e26e4b4e8d903
|
|
BLAKE2b-256 checksum How to use checksums |
8b2b1bf9f17c1ca8a704d98feb35c496853268139b17f227f231c6882de95d18
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.0
|