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...

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.2.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

genzshcomp-0.2-py2.6.egg (8.9 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for genzshcomp-0.2.tar.gz
Algorithm Hash digest
SHA256 aef1c6e25401d3d00eb6787b53f27dee8793a4f3d951b7be22ad07c2170b0104
MD5 ecb2fdd1901205828557f15af21bdca7
BLAKE2b-256 e444815279d02d6eebc1963c269ab2ccc5d34ce3c5369a897eecb3624210c9d4

See more details on using hashes here.

File details

Details for the file genzshcomp-0.2-py2.6.egg.

File metadata

File hashes

Hashes for genzshcomp-0.2-py2.6.egg
Algorithm Hash digest
SHA256 b1602e0d93c24d0b54b9c9b0c9edef7a3c8b6c9df24a106aaaa77f1553b79afd
MD5 76849b4edabda8aff9539646a803034e
BLAKE2b-256 dc666f973e5e12fb10d11ae309212ba52268759c0c7f9085d490e98fa8b1acdd

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