Skip to main content

Automatic generated to zsh completion function, for Python's Option Parser Modules.

Project description

About

https://drone.io/bitbucket.org/hhatto/genzshcomp/status.png

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.

Installation

used to pip:

$ pip install genzshcomp

used to easy_install:

$ easy_install genzshcomp

Requirements

  • Python2.6+

Usage

show example dir…

from code of option parser object

basic usage:

## gen.py
from genzshcomp import CompletionGenerator
from optparse import OptionParser
parser = OptionParser()
generator = CompletionGenerator(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 Bash Completion

using shell pipe:

$ pep8 --help | genzshcomp -f bash > /etc/bash_completion.d/pep8
$ bash

Support commands

and more…

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

Uploaded Source

Built Distribution

genzshcomp-0.5.2-py2.7.egg (11.7 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for genzshcomp-0.5.2.tar.gz
Algorithm Hash digest
SHA256 d28ae62b1b2727f32dc7606bc58201b8c12894ad3d1d4fdb40e1f951e3ae8f85
MD5 fe5f02380c10af5341c7fdd9efacc716
BLAKE2b-256 3d2c3e02d2aa8bff82235bebbee3a2b0599e59767954a0dbd0038913ec72507d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genzshcomp-0.5.2-py2.7.egg
Algorithm Hash digest
SHA256 91e2ef564100cba047da90559852127549c68f8dbccf958a17af1920f89bf4ac
MD5 530fa5a027c924f1a6d7c5790e3900d8
BLAKE2b-256 29ef4e3d1ec21b22cabdc7a54f3d0780a009ca690d76dd3e87ee6ede91d6cbe6

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