Automatic generated to zsh completion function, for Python's Option Parser Modules.
Project description
About
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.
Install
used to pip:
$ pip install genzshcomp
used to easy_install:
$ easy_install genzshcomp
Require
Python2.6+
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…
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file genzshcomp-0.5.1.tar.gz
.
File metadata
- Download URL: genzshcomp-0.5.1.tar.gz
- Upload date:
- Size: 12.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c77d007cc32cdff836ecf8df6192371767976c108a75b055e057bb6f4a09cd42 |
|
MD5 | 7a954f1835875002e9044fe55ed1b488 |
|
BLAKE2b-256 | e728c07d08d0c44044695fcdf41ddf0b82404718991e8b65a06058ee6ba9c2a8 |
File details
Details for the file genzshcomp-0.5.1-py2.7.egg
.
File metadata
- Download URL: genzshcomp-0.5.1-py2.7.egg
- Upload date:
- Size: 11.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 194650d2c5acabf6b035e5a0cb8fa6d212f512171a96f395fb6fcdeeb2d6c942 |
|
MD5 | 6f2879da56caa5a35eea27fb6ffda3a9 |
|
BLAKE2b-256 | 249181f00390181e2181f86636f6c37ade0a576b6e0b97510917afc7d9c3bb1a |