Auto argument completion for script with argparse.
Project description
auto-argcomplete is automatic shell completion generator for script which uses argparse.
The behavior is like:
$ python example/simple_script.py <TAB> $ python example/simple_script.py -- --dry-run --help --kick-off --module
If you’re using zsh:
% python example/simple_script.py -- --dry-run -- display what to do --help -- show this help message and exit --module -- specify module name --kick-off
example/simple_script.py is:
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-m', '--module', help='specify module name')
parser.add_argument('-n', '--dry-run', help='display what to do')
parser.add_argument('-k', '--kick-off')
parser.parse_args()
Nothing to import in the script! :smile:
auto-argcomplete can automatically understand the output of --help option, so automatically supports all script which use argparse.
Installation
$ pip install auto-argcomplete
Test
$ nosetests -v auto_argcomplete
License
Copyright (C) 2015 Kentaro Wada
Released under the MIT license
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file auto-argcomplete-0.9.7.tar.gz
.
File metadata
- Download URL: auto-argcomplete-0.9.7.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
6ca055d2758c98ed032bb7af2cb26326dacccc14da93f7c0841dde776ab3cc3f
|
|
MD5 |
2c760d078b4b40673f8af10a3a8e33fd
|
|
BLAKE2b-256 |
61cf8cb2b15c16537f879512f0ae7e7ea9b7c8bac7f2491dcd98a84f36941420
|