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

Uploaded Source

Built Distribution

genzshcomp-0.3.1-py2.7.egg (10.9 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for genzshcomp-0.3.1.tar.gz
Algorithm Hash digest
SHA256 7f1d8368bd3332a40edf9ba354eb0ecb912ff360990873bc01a385dc89f88365
MD5 ddd3107af9106086ce2912a2536e4832
BLAKE2b-256 b4be5d6f6cda22e969a26d98b1e24de3641fe1b4fbf159d6bf03ce7442621a9d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genzshcomp-0.3.1-py2.7.egg
Algorithm Hash digest
SHA256 6a8f824bf08eb026c342e3c0c36fa2ddbcb8222c1f1dfa1720f6d35815e54c73
MD5 6431c091eacd7b8b8aea7e221a999c17
BLAKE2b-256 6e556bc7a5ce5597dacc593851ec207f9a55af8424f7ef70e713aa144e4e0fac

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