genzshcomp
Automatic generate to Zsh Completion Function from Python’s Option Parser Modules.
Now, It corresponds to argparse module and optparse module.
I write this module because I want to be created grin command’s Zsh Completion Function.
Installation
used to pip:
$ pip install genzshcomp
used to easy_install:
$ easy_install genzshcomp
Requirements
Python3.5+
Usage
show example dir…
from code of option parser object
basic usage:
## gen.py from genzshcomp import CompletionGenerator from optparse import OptionParser parser = OptionParser() generator = CompletionGenerator(command_name, parser) print generator.get()
and zsh completion setups:
$ python gen.py > ~/.zsh/comp/_command $ echo "fpath=(~/.zsh/comp/ $fpath)" >> ~/.zshrc $ echo "autoload -U ~/.zsh/comp/*(:t)" >> ~/.zshrc $ echo "autoload -Uz compinit" >> ~/.zshrc
from help-strings
basic usage and zsh completion setups (ex.pep8 command):
$ pep8 --help > pep8help.txt $ genzshcomp pep8help.txt > ~/.zsh/comp/_pep8 $ echo "fpath=(~/.zsh/comp/ $fpath)" >> ~/.zshrc $ echo "autoload -U ~/.zsh/comp/*(:t)" >> ~/.zshrc $ echo "autoload -Uz compinit" >> ~/.zshrc
using shell pipe:
$ pep8 --help | genzshcomp > ~/.zsh/comp/_pep8 # As follows...
Support Bash Completion
using shell pipe:
$ pep8 --help | genzshcomp -f bash > /etc/bash_completion.d/pep8 $ bash
Support commands
grin/grind (grin –help)
gunicorn (gunicorn –help)
markdown2 (markdown2 –help)
paver (paver –help)
pep8 (pep8 –help)
pylint (pylint –long-help)
and more…
Release files for genzshcomp 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| genzshcomp-0.6.0.tar.gz | 13.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| genzshcomp-0.6.0-py3.8.egg | Legacy Egg format | - | - | Details |
Total release size: 25.2 kB
Release files / genzshcomp-0.6.0.tar.gz
| Download URL | genzshcomp-0.6.0.tar.gz |
|---|---|
| Size | 13.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b582910d36f9ad0992756d7e9ccbe3e5cf811934b1002b51f25b99d3dda9d573
|
|
BLAKE2b-256 checksum How to use checksums |
0b34e4129a3f898a35db4de999acf75371e79fe852d5581ecf57f288d9ac4fc6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Python-urllib/3.8
|
Release files / genzshcomp-0.6.0-py3.8.egg
| Download URL | genzshcomp-0.6.0-py3.8.egg |
|---|---|
| Size | 11.7 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
7f42c53c864f05b128ffca9d250e4fea34ff5876273a4ef838e152543a8483b4
|
|
BLAKE2b-256 checksum How to use checksums |
ff31f89662599f882e44f67fab2054eb6bb42011f97f1477d903f0d8e1e4af1a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Python-urllib/3.8
|