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

Uploaded Source

Built Distribution

genzshcomp-0.0.8-py2.6.egg (8.3 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for genzshcomp-0.0.8.tar.gz
Algorithm Hash digest
SHA256 43a49533bfb47900593eb37b69f383d0edc37bec73eaf8f2fcfac69b54ea8b1b
MD5 cdbc943cb1779cacf2ae21bb7edfd90a
BLAKE2b-256 3f3c8c8c2e5ef4a017ce3ef47c035a814bbc63be5387450aabf977162b349bfc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genzshcomp-0.0.8-py2.6.egg
Algorithm Hash digest
SHA256 1107f52f94447e37062fdaaf61df0d3a3be4f7287f48b7a887732a58d06dfad3
MD5 9019524796b8acb2d24633321ea128d2
BLAKE2b-256 8574a88e8a9ffb33315c69fe1c0ee6dad8ba397a21bc89b32fad24136b975b22

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