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
chmod +x proto.py
./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 on stack with Ubuntu, xonsh, conda. 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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24c165c1dfd5a8085770af2e2c0694e053c66ece8c41aa12aa669b6d7beb5de6 |
|
MD5 | 93d799a150451ec6a6941d90f56409d2 |
|
BLAKE2b-256 | dd114e0c6e416ce90d69c09da3e2266bf84adebf7e766c63412e16f57dae7c45 |
Close
Hashes for xontrib_argcomplete-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | efc1f8f5bdcc61e899ef9da65fbdbbcac89dba87da7680c6eeb46be274f96ada |
|
MD5 | ba7d544ab56af930e26530b786b01665 |
|
BLAKE2b-256 | d9da32672cb122a00b487d5e68ddc7c0aba82b9697946bc15b3462b0c52d4174 |