An extension to click that easily turns your click app into a shell utility
Project description
click-shell is an extension to click that easily turns your click app into a shell utility. It is built on top of the built in python cmd module, with modifications to make it work with click.
Usage
Simply replace @click.group with @click_shell.shell on the root level command:
from click_shell import shell
# @click.group() # no longer
@shell(prompt='my-app > ', intro='Starting my app...')
def my_app(ctx):
pass
@my_app.command()
def the_command():
print 'the_command is running'
...
When run, you should expect an output like so:
$ python my_app.py
Starting my app...
my-app >
For more advanced usage, check out our docs at http://click-shell.readthedocs.org/
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-shell-0.1.tar.gz
(6.1 kB
view details)
Built Distribution
File details
Details for the file click-shell-0.1.tar.gz
.
File metadata
- Download URL: click-shell-0.1.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91086030f348237a17c6f9b34566091073dd768b5ac8b8950dafc69e26dccd39 |
|
MD5 | efe9f7ea6d703287266a895049f5fbcf |
|
BLAKE2b-256 | 95c33b7d21021ecf882cacfc2dd95661fee05341b2a963624cf556e0677f08e6 |
File details
Details for the file click_shell-0.1-py2.py3-none-any.whl
.
File metadata
- Download URL: click_shell-0.1-py2.py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35599e322f6d010dbe043e840feb6941b07f6f9ebad0a2f200abbe3c185ae376 |
|
MD5 | 055965bf40f2ce267569b1f74606e0f7 |
|
BLAKE2b-256 | 0bc7d5c1f17fb53214bb81f616a4859abc0bc4b13900ec7692bc1f8b3dd9f28b |