Skip to main content

Click command aliaser

Project description

Says the original author:

This is experimental, which is why it’s not on PyPI.

Says the new step parent:

Get out there and make me proud!

(This code is experimental, but it works for me. I found it on GitHub, and now I’ve published it on PyPI. Enjoy!)

Description

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

In your click app:

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
click_alias-0.1.1a3-py2.py3-none-any.whl (3.0 kB) Copy SHA256 hash SHA256 Wheel py2.py3
click-alias-0.1.1a3.tar.gz (2.8 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page