Enable aliasing and unique matching for Click
Project description
click-aliasing
Add (multiple) aliasing to a click_ group or command.
In your click app:
import click
from click_aliasing import ClickAliasedGroup
@click.group(cls=ClickAliasedGroup)
def cli():
pass
@cli.command(aliases=["bar", "baz", "qux"])
def foo():
"""Run a command."""
click.echo("foo")
Will result in:
Usage: cli [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Commands:
foo (bar,baz,qux) Run a command.
Command can also be called with a unique short match:
cli f
>>foo
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
click_aliasing-1.0.0.tar.gz
(2.9 kB
view hashes)
Built Distribution
Close
Hashes for click_aliasing-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b11a0fbdf74f62570f97cb2f22cbfaf0af020ef58fe7c540708cd3cfa766f0fe |
|
MD5 | 118fc00d016e31eaa6c669f5851b0a49 |
|
BLAKE2b-256 | b512d730a3c4cf6a96402a4de65bb356aff58bd6e9e99297be799f14a613b035 |