A library that allows you to add aliases to your Click group and commands.
Project description
Click With Aliasing
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
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.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file click_with_aliasing-1.0.2.tar.gz.
File metadata
- Download URL: click_with_aliasing-1.0.2.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d247e7ec1d7cc6a94d5624039684f3e3fd45edf605b1f771ceca24807829b6db
|
|
| MD5 |
a561e397a9d755a9026c86d6d8f55b0c
|
|
| BLAKE2b-256 |
c9ade12a54ae5376e164044eae340c9c7d9c9dfbb1ee13e02e7d45390baee547
|
File details
Details for the file click_with_aliasing-1.0.2-py3-none-any.whl.
File metadata
- Download URL: click_with_aliasing-1.0.2-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
274d2f0a35a4b2c16767602a106ed2067f74ede19c84fa8a7e239622ee707c66
|
|
| MD5 |
1115998fe9415d43f2d03ab1b5593b46
|
|
| BLAKE2b-256 |
e51ed6a2c54f4d6d545840c2329d6c94d8e528bfaac2eb5ae941886ec95299c4
|