Skip to main content

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 ZshCompletionGenerator
from optparse import OptionParser
parser = OptionParser()
generator = ZshCompletionGenerator(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 commands

and…

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

genzshcomp-0.3.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

genzshcomp-0.3-py2.7.egg (9.9 kB view details)

Uploaded Source

File details

Details for the file genzshcomp-0.3.tar.gz.

File metadata

  • Download URL: genzshcomp-0.3.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for genzshcomp-0.3.tar.gz
Algorithm Hash digest
SHA256 fd2fd3e660b35dd43be5e99f29670e6c4a8c4ed29bcab6a2e14d67a964a81e19
MD5 a1097f9697d503e6b45edd89f937d284
BLAKE2b-256 dc2d107cbf655cb85ba24abf44a1f41e09640fb38c25ac560d749d7f8f330567

See more details on using hashes here.

File details

Details for the file genzshcomp-0.3-py2.7.egg.

File metadata

File hashes

Hashes for genzshcomp-0.3-py2.7.egg
Algorithm Hash digest
SHA256 db86a3bc1ffa569ff1c639b2ba1e9cfbc661e6ffa494e1febda26cca7f9fea98
MD5 ede2c30ed2eb4ff99f36f5ef4abf3787
BLAKE2b-256 914a56c3c6a8285ea2c1f2ec61c9b27fe5daaec5c989bb60e3775e96aa73f3e2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page