Project: click-aliases

Add (mutiple) aliases to a click group or command

Project Details

Latest version
1.0.4
Home Page
PyPI Page
https://pypi.org/project/click-aliases/

Project Popularity

PageRank
0.0015257736030499863
Number of downloads
107158

click-aliases

build license coverage

Add (multiple) aliases to a click_ group or command.

In your click app:

import click
from click_aliases 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.