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 Ubuntu+Conda+Xonsh and on Mac.
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.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57d43a05577f7e2884c20d8ad5d02b1714c9e5fef43a237f27fd4655bd963720 |
|
MD5 | c3b6d050966c28279582c0b76d207b89 |
|
BLAKE2b-256 | 25ab70ed9d73f6e409fa90a8f6c7cdd9508940e07789adeedcabdb1bea079b83 |
Close
Hashes for xontrib_argcomplete-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6a5058096fff2b3ac60e956a618e3f014fa07ca8b60fdcdf24d3d0873303b5a |
|
MD5 | 7eba916b8538648c5579df1d2bbdc938 |
|
BLAKE2b-256 | baa3830a9f6e274566c960eb28ad1b57b52c99fb22304827c8ae5ac5dc2ce28d |