Metadata-Version: 2.2
Name: click_with_aliasing
Version: 1.0.3
Summary: A library that allows you to add aliases to your Click group and commands.
Author-email: Marcus Fredriksson <marcus@marcusfredriksson.com>
License: MIT License
        
        Copyright (c) 2025 Marcus Fredriksson
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/marcusfrdk/click-with-aliasing
Project-URL: Repository, https://github.com/marcusfrdk/click-with-aliasing
Project-URL: Issues, https://github.com/marcusfrdk/click-with-aliasing/issues
Keywords: click,alias,group,command
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click>=8.1.8
Provides-Extra: build
Requires-Dist: build; extra == "build"
Requires-Dist: twine; extra == "build"
Provides-Extra: dev
Requires-Dist: black>=24.10.0; extra == "dev"
Requires-Dist: pytest>=8.3.4; extra == "dev"
Requires-Dist: isort>=5.13.2; extra == "dev"
Requires-Dist: pylint>=3.3.2; extra == "dev"
Requires-Dist: pre-commit>=4.0.1; extra == "dev"

# Click With Aliasing

![top language](https://img.shields.io/github/languages/top/marcusfrdk/click-with-aliasing)
![code size](https://img.shields.io/github/languages/code-size/marcusfrdk/click-with-aliasing)
![last commit](https://img.shields.io/github/last-commit/marcusfrdk/click-with-aliasing)
![issues](https://img.shields.io/github/issues/marcusfrdk/click-with-aliasing)
![contributors](https://img.shields.io/github/contributors/marcusfrdk/click-with-aliasing)
![PyPI](https://img.shields.io/pypi/v/click-with-aliasing)
![License](https://img.shields.io/github/license/marcusfrdk/click-with-aliasing)

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](https://pypi.org/project/click-with-aliasing/):

```bash
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:

```python
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:

```python
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](LICENSE) file for details.
