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

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

Uploaded Source

Built Distribution

genzshcomp-0.0.7-py2.6.egg (7.2 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for genzshcomp-0.0.7.tar.gz
Algorithm Hash digest
SHA256 45f7786400afa8b980a8997729168dc5f482207ea1beb2fcb8e80cff2c886863
MD5 e9aea92beccdb367bf07dc5128ad4183
BLAKE2b-256 931c46125f174366e1ca1e4cb7dd75448b574c6dc32a78f61f0a29c755e71029

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genzshcomp-0.0.7-py2.6.egg
Algorithm Hash digest
SHA256 bb2aca5c8eaaf84f289c8671e4883fa28b591770d36fa602751622989e58437b
MD5 1835a8b7b6f29710dad6429c8517d3be
BLAKE2b-256 4e14aa5726a31ac176b72cbfb9c9ca59a3510b32c4e3daa92a1577225230cfc9

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