Skip to main content

genzshcomp

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

  • Python3.5+

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…

Release files for genzshcomp 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for genzshcomp 0.6.0
File Size Uploaded
genzshcomp-0.6.0.tar.gz 13.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for genzshcomp 0.6.0
File Interpreter ABI Platform
genzshcomp-0.6.0-py3.8.egg Legacy Egg format - - Details

Total release size: 25.2 kB

Release files / genzshcomp-0.6.0.tar.gz

Download URL genzshcomp-0.6.0.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b582910d36f9ad0992756d7e9ccbe3e5cf811934b1002b51f25b99d3dda9d573
BLAKE2b-256 checksum
How to use checksums
0b34e4129a3f898a35db4de999acf75371e79fe852d5581ecf57f288d9ac4fc6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.8

Release files / genzshcomp-0.6.0-py3.8.egg

Download URL genzshcomp-0.6.0-py3.8.egg
Size 11.7 kB
Tags Egg
SHA-256 checksum
How to use checksums
7f42c53c864f05b128ffca9d250e4fea34ff5876273a4ef838e152543a8483b4
BLAKE2b-256 checksum
How to use checksums
ff31f89662599f882e44f67fab2054eb6bb42011f97f1477d903f0d8e1e4af1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.8

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5

2 release files

0.3.1

2 release files

0.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2

2 release files

0.1

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page