Adding support of kislyuk/argcomplete to xonsh.
Project description
Adding support of kislyuk/argcomplete to xonsh.
If you like the idea of xontrib-argcomplete click ⭐ on the repo and stay tuned by watching releases.
Install
xpip install -U xontrib-argcomplete
echo 'xontrib load argcomplete' >> ~/.xonshrc
# Reload xonsh
Usage
Current version of completion is working only for commands that starts with:
python <path/to/python_script.py> ...
<path/to/python_script.py> ...
For example create proto.py
with the content:
#!/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
./proto.py --proto tt<Tab>
# Suggestions: http https
Known issues
This is the alpha version of the xontrib-argcomplete and the proof of concept. It was tested in Ubuntu with xonsh 0.21. Help to improve it by opening a detailed issues and making pull requests. Thanks!
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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c30bd6249f78036c1d6f42c96655ab9095c8d6cb669eeebe29b8b663356a4b4e |
|
MD5 | 2b2350309e68b8812551dfd0bcd2bd0c |
|
BLAKE2b-256 | 56fdd2c014612afcb7496cd21b5548b531e482c99543ca76ebba17b0eb03fc16 |
Close
Hashes for xontrib_argcomplete-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1384c05140c18f9b45c8f583d436aff1c908951108ec20ef4da0300fa7310e0b |
|
MD5 | c57aba36b9dab12e46d52803f129b013 |
|
BLAKE2b-256 | 14b4b2da04515329e80485e871bd4e87b462210121b5adbb6a323c441ea1f315 |