Skip to content

Commit 7ef5d5c

Browse files
committed
Updated README
1 parent 98f3bba commit 7ef5d5c

File tree

1 file changed

+55
-1
lines changed

1 file changed

+55
-1
lines changed

README.md

+55-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,57 @@
11
# Click With Aliasing
22

3-
Easily add aliases to your Click groups and commands.
3+
![top language](https://img.shields.io/github/languages/top/marcusfrdk/click-with-aliasing)
4+
![code size](https://img.shields.io/github/languages/code-size/marcusfrdk/click-with-aliasing)
5+
![last commit](https://img.shields.io/github/last-commit/marcusfrdk/click-with-aliasing)
6+
![issues](https://img.shields.io/github/issues/marcusfrdk/click-with-aliasing)
7+
![contributors](https://img.shields.io/github/contributors/marcusfrdk/click-with-aliasing)
8+
![PyPI](https://img.shields.io/pypi/v/click-with-aliasing)
9+
![PyPI - Downloads](https://img.shields.io/pypi/dm/click-with-aliasing)
10+
![License](https://img.shields.io/github/license/marcusfrdk/click-with-aliasing)
11+
![Build Status](https://img.shields.io/travis/com/marcusfrdk/click-with-aliasing)
12+
![Coverage](https://img.shields.io/codecov/c/github/marcusfrdk/click-with-aliasing)
13+
14+
This is a project that adds decorators that replaces the default `click.group` and `click.command` decorators with custom ones that support aliasing.
15+
16+
## Installation
17+
18+
You can install the package from [PyPI](https://pypi.org/project/click-with-aliasing/):
19+
20+
```bash
21+
pip install click-with-aliasing
22+
```
23+
24+
The package is available for Python 3.11 and newer.
25+
26+
## Usage
27+
28+
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.
29+
30+
Here is an example of how to use the `group` decorator:
31+
32+
```python
33+
from click_with_aliasing import group
34+
35+
@group(name="my_group", aliases=['mg'])
36+
def cli():
37+
""" My Click group """
38+
```
39+
40+
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.
41+
42+
The same works for the `command` decorator:
43+
44+
```python
45+
from click_with_aliasing import command
46+
47+
@command(name="my_command", aliases=['mc'])
48+
def my_command():
49+
""" My Click command """
50+
...
51+
```
52+
53+
Like the group, you can call the command using either `my_command` or `mc`.
54+
55+
## License
56+
57+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

0 commit comments

Comments
 (0)