-
-
Notifications
You must be signed in to change notification settings - Fork 777
Closed
Labels
Description
It would be nice to have command aliases, when all these commands do the same thing:
my-app delete
my-app uninstall
my-app d
There is a module for click which can do it: https://github.com/click-contrib/click-aliases
Code looks like this:
import click
from click_aliases import ClickAliasedGroup
@click.group(cls=ClickAliasedGroup)
def cli():
pass
@cli.command(aliases=["i", "inst"])
def install():
click.echo("install")
@cli.command(aliases=["d", "uninstall", "remove"])
def delete():
click.echo("delete")
Also this module click-aliases add info about alises to help:
Usage: t3 [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Commands:
delete (d,remove,uninstall)
install (i,inst)
senpos, flisboac, b-long and definite-d