Adding support of kislyuk/argcomplete to xonsh.
Project description
Adding support of kislyuk/argcomplete to xonsh.
If you like the idea click ⭐ on the repo and stay tuned by watching releases.
Install
xpip install -U xontrib-argcomplete
echo 'xontrib load argcomplete' >> ~/.xonshrc
# Reload xonsh
Usage
For example create proto.py
:
#!/usr/bin/env python
# PYTHON_ARGCOMPLETE_OK
import argparse, argcomplete
from argcomplete.completers import ChoicesCompleter
parser = argparse.ArgumentParser()
parser.add_argument("--proto").completer=ChoicesCompleter(('http', 'https', 'ssh', 'rsync', 'wss'))
argcomplete.autocomplete(parser)
args = parser.parse_args()
print('ok')
Then try completion:
python proto.py <Tab>
# Suggestions: --help --proto -h
chmod +x proto.py
./proto.py --proto tt<Tab>
# Suggestions: http https
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
Built Distribution
Close
Hashes for xontrib-argcomplete-0.0.7.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3782fb8d1560ebff6dd149541ee797e0ecee5a5eb217053809ae0389f369935f |
|
MD5 | 838e86f804b2d6e6c144143387417996 |
|
BLAKE2b-256 | 442bc7348c19932c4c0dabb2163235b4d336a698a2ab83996fc23c18a0e76940 |
Close
Hashes for xontrib_argcomplete-0.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30ef4ffa1b611f799d2d7e50b1528a0c9904a6b2feda6a62238602d5bfd25425 |
|
MD5 | a3ab826855203241943ed41d2b1bda92 |
|
BLAKE2b-256 | 3b805fe9cf522d69175048ecaef456ef2128594d3eceb46721209a5c39518934 |