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

Uploaded Source

Built Distribution

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

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for genzshcomp-0.1.tar.gz
Algorithm Hash digest
SHA256 a7351821758f4947587003725b152aa28ceb294a9b7d42b1066b3cb11a0725c4
MD5 573563129d39fe1d1c2b4681753e5993
BLAKE2b-256 5a73582018f9072cb78d5ecbf73cf53b0003893897a1057d978f3e9c6f8d7e76

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genzshcomp-0.1-py2.6.egg
Algorithm Hash digest
SHA256 77811053043b1df0b64270f44ff5e46b70015038a8d3fe4092f85bc9640c9cf1
MD5 c613ba2f99dadce7c7bebecfd7b54771
BLAKE2b-256 4fd546d277a9d040c09e93526df29bf21d62e218b893b4eb665d90f9e17ed9b6

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