Click Default Group
DefaultGroup is a sub class of click.Group. But it invokes a default
subcommand instead of showing a help message when a subcommand is not passed.
Usage
Define a default subcommand by default=NAME:
import click
from click_default_group import DefaultGroup
@click.group(cls=DefaultGroup, default='foo', default_if_no_args=True)
def cli():
pass
@cli.command()
def foo():
click.echo('foo')
@cli.command()
def bar():
click.echo('bar')
Then you can invoke that without explicit subcommand name:
$ cli.py --help
Usage: cli.py [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Command:
foo*
bar
$ cli.py
foo
$ cli.py foo
foo
$ cli.py bar
bar
Compatibility
click-default-group is compatible with these Click versions:
- Click-7.0
- Click-6.x
- Click-5.1
- Click-5.0
- Click-4.1
- Click-4.0
See the latest build status at Travis CI.
Licensing
Written by Heungsub Lee, and distributed under the BSD 3-Clause license.
Metadata
Release files for click-default-group 1.2.4
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 | |
|---|---|---|---|---|
| click_default_group-1.2.4.tar.gz | 3.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| click_default_group-1.2.4-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 7.6 kB
Release files / click_default_group-1.2.4.tar.gz
| Download URL | click_default_group-1.2.4.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eb3f3c99ec0d456ca6cd2a7f08f7d4e91771bef51b01bdd9580cc6450fe1251e
|
|
BLAKE2b-256 checksum How to use checksums |
1dceedb087fb53de63dad3b36408ca30368f438738098e668b78c87f93cd41df
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Release files / click_default_group-1.2.4-py2.py3-none-any.whl
| Download URL | click_default_group-1.2.4-py2.py3-none-any.whl |
|---|---|
| Size | 4.1 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
9b60486923720e7fc61731bdb32b617039aba820e22e1c88766b1125592eaa5f
|
|
BLAKE2b-256 checksum How to use checksums |
2c1aaff8bb287a4b1400f69e09a53bd65de96aa5cee5691925b38731c67fc695
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Security for click-default-group 1.2.4
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.