Skip to main content

Click Supercharged is a Python package that enhances the Click command-line framework by adding support for default commands, command aliases, and abbreviations. Simplify command management with features like ambiguity resolution and improved command organization.

Project description

Tests

Click Supercharged

Overview

click-supercharged is a Python package that enhances the Click command line interface framework by providing support for default commands and command aliases. This project allows developers to organize their command-line interfaces in a more flexible and user-friendly manner.

Features

  • Default Command: Specify a default command that executes when no command is provided.
  • Command Aliases: Create multiple aliases for commands to improve usability and avoid lengthy command names.
  • Abbreviations: Use abbreviations instead the full command. Handles ambiguous command inputs gracefully and informs the user about multiple matches.

Installation

You can install click-supercharged via PyPI:

pip install click-supercharged

Usage

To use the SuperchargedClickGroup, you can set it as the command group in your Click application as shown below:

import click
from click_supercharged import SuperchargedClickGroup

@click.group(cls=SuperchargedClickGroup)
def cli():
    pass

@cli.command(default_command=True, aliases=["bar"])
def foo():
    click.echo("foo")

@cli.command(aliases=["bax", "bez", "buz"])
def baz():
    click.echo("baz")

if __name__ == "__main__":
    cli()

Running your CLI

When you run the script, you can execute:

  • python your_script.py to invoke the default command foo.
  • python your_script.py f to invoke the command foo using its abbreviation.
  • python your_script.py ba to see error handling for ambiguous commands.

Testing

The project includes unit tests to ensure functionality. You can run the tests using the following command:

python -m unittest discover

Contributing

Contributions are welcome! Please submit a pull request or open an issue to discuss improvements or features.

License

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

Acknowledgments

  • Click - The command-line interface framework that this project builds upon.

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_supercharged-1.0.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

click_supercharged-1.0.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: click_supercharged-1.0.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for click_supercharged-1.0.0.tar.gz
Algorithm Hash digest
SHA256 4426d4b572230012734c777974f65fc5ffd05d4df3b35367301320a14f75a1b8
MD5 d75bef19a7ed4de576a3d71d4930c70b
BLAKE2b-256 433a9b57c2382791c06f68730928f34bf12b4dcbfeb6d2ca85b78f9c40b0f130

See more details on using hashes here.

Provenance

The following attestation bundles were made for click_supercharged-1.0.0.tar.gz:

Publisher: python-publish.yml on zirition/click-supercharged

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for click_supercharged-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b8731ab8403e4f9536f7bfc6801c33c6ecb8a42fd658888d8af1605f1e82a6d1
MD5 ccdcab1c75e2e443071f3619c7bd10ec
BLAKE2b-256 85909e6526f1413c31a53b8aabbd4dba3e69d735f92cb92381f052fdee98532c

See more details on using hashes here.

Provenance

The following attestation bundles were made for click_supercharged-1.0.0-py3-none-any.whl:

Publisher: python-publish.yml on zirition/click-supercharged

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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