Skip to main content

A library that allows you to add aliases to your Click group and commands.

Project description

Click With Aliasing

top language code size last commit issues contributors PyPI License

This is a project that adds decorators that wraps the default click.group and click.command decorators with custom ones that support aliasing.

Installation

You can install the package from PyPI:

pip install click-with-aliasing

The package is available for Python 3.11 and newer.

Usage

The package provides two decorators: group and command. They work exactly like the original click.group and click.command decorators, but they also support aliasing using the aliases argument.

Here is an example of how to use the group decorator:

from click_with_aliasing import group
from .my_command import my_command

@group(name="my_group", aliases=['mg'])
def cli():
    """ My Click group """

cli.add_command(my_command)

This group works exactly like a normal click.group, but while using the CLI, you can use either my_group or mg to call the group.

The same works for the command decorator:

from click_with_aliasing import command

@command(name="my_command", aliases=['mc'])
def my_command():
    """ My Click command """
    ...

Like the group, you can call the command using either my_command or mc.

You can now call the command using mg mc or any combination of the aliases.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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_with_aliasing-1.0.3.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

click_with_aliasing-1.0.3-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file click_with_aliasing-1.0.3.tar.gz.

File metadata

  • Download URL: click_with_aliasing-1.0.3.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for click_with_aliasing-1.0.3.tar.gz
Algorithm Hash digest
SHA256 791ad79dddccb1b1e5d74e7e1f7f0ef058b88d28dea9fe31e20287f8654bca34
MD5 5d788dc4aa3d65e2a3da8b240600d8cf
BLAKE2b-256 84cd2c9346d05c32090b14e783c31fb00c5a6390c60f08891e23fdc8f00174d2

See more details on using hashes here.

File details

Details for the file click_with_aliasing-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for click_with_aliasing-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b29219d5c593c2632809d20b951841a958554f9966d0f7acb709525d6b420474
MD5 03c1ed8cc32057ce82169f152b49452b
BLAKE2b-256 c95278b6d1c3a1f6d19756c1e3da7804cf61cafbf144b3fca7829679e77eecca

See more details on using hashes here.

Supported by

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