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
The xontrib was tested on Ubuntu+Conda+Xonsh and on Mac+Brew+PyPi+Xonsh.
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.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68766c474b8fc55815665017d5220187dd2a5fc3e8d4f055917742c7db20a070 |
|
MD5 | b0c87b17153bbf482e79097bdb3f6914 |
|
BLAKE2b-256 | 26573e8802b53c59129cde31c26dd397eb7e031d10450bbb6a374f202f9171b9 |
Close
Hashes for xontrib_argcomplete-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 334648cfb268fb35b5592bf7c5a9fc50d54a5fc4c039c2480b7fd6c1f73e5d4a |
|
MD5 | a5d6bc5328f477669e9d4a5a504484f2 |
|
BLAKE2b-256 | 25de33d77460d96528f38121a6c28e6aea6fbf8c14194de4e177660d0b2324a5 |