Skip to main content

Easily add aliases to your Click groups and commands.

Project description

Click With Aliasing

top language code size last commit issues contributors PyPI PyPI - Downloads License Build Status Coverage

This is a project that adds decorators that replaces 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

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

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.

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.0.tar.gz (5.1 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.0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for click_with_aliasing-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0ac5ab9ab7d1fc8532afee03ce9bd4a6cf141a1ed6438257a0fbe6b58cce004e
MD5 c89ed277292777e59a8dca2613d823eb
BLAKE2b-256 6edd86ed12ebb1b73669ff40d352b5f07b0c6058d551ed7851c9584d64c4854b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for click_with_aliasing-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1bf72165cb53969b37b578d46f936e2541efbd4e4889b3f54ec650d7cc7a8174
MD5 fdd164d7432fd5f34ca087f3eded03a8
BLAKE2b-256 186c3d4fc7b3d023472fbd0f1d47281a6fead7b8a37a7f10bdc46c9fc386b90f

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