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 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…

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

Uploaded Source

Built Distribution

genzshcomp-0.5-py2.7.egg (11.8 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for genzshcomp-0.5.tar.gz
Algorithm Hash digest
SHA256 fdeab947b064d1f039aab8130b5fe472d019bf17dc64389a0baff797bb81291b
MD5 4498d968294414d38833adf2f3672439
BLAKE2b-256 73eade54afc7003222fc7c80ac695fa8d3632766207651bec4fcec9ebee80fb3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: genzshcomp-0.5-py2.7.egg
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for genzshcomp-0.5-py2.7.egg
Algorithm Hash digest
SHA256 4b093e2f30b077941a591895c0c0394ca5d5b82174113a9682d5fee5f5226b76
MD5 22e03307d9c177985b036a45c4f17021
BLAKE2b-256 77f65aef0fa8597c5c9f43caab054768b768c2dd83cfa8c09b7571484ae07631

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