Skip to main content

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


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 details)

Uploaded Source

Built Distribution

click_aliasing-1.0.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file click_aliasing-1.0.0.tar.gz.

File metadata

  • Download URL: click_aliasing-1.0.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.0 CPython/3.11.2 Darwin/22.4.0

File hashes

Hashes for click_aliasing-1.0.0.tar.gz
Algorithm Hash digest
SHA256 294ef7437a5a3ae7bac6c9381c7558fd057462c1b1555cb921d2d6d6818d15b8
MD5 945bbba23d80a65042977b68aec005f9
BLAKE2b-256 fcca61f8791fb61587dcaca0e9343cb84d96e48473c203e96408d56723623ed3

See more details on using hashes here.

File details

Details for the file click_aliasing-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: click_aliasing-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.0 CPython/3.11.2 Darwin/22.4.0

File hashes

Hashes for click_aliasing-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b11a0fbdf74f62570f97cb2f22cbfaf0af020ef58fe7c540708cd3cfa766f0fe
MD5 118fc00d016e31eaa6c669f5851b0a49
BLAKE2b-256 b512d730a3c4cf6a96402a4de65bb356aff58bd6e9e99297be799f14a613b035

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page