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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xontrib-argcomplete-0.0.1.tar.gz.
File metadata
- Download URL: xontrib-argcomplete-0.0.1.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c30bd6249f78036c1d6f42c96655ab9095c8d6cb669eeebe29b8b663356a4b4e
|
|
| MD5 |
2b2350309e68b8812551dfd0bcd2bd0c
|
|
| BLAKE2b-256 |
56fdd2c014612afcb7496cd21b5548b531e482c99543ca76ebba17b0eb03fc16
|
File details
Details for the file xontrib_argcomplete-0.0.1-py3-none-any.whl.
File metadata
- Download URL: xontrib_argcomplete-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1384c05140c18f9b45c8f583d436aff1c908951108ec20ef4da0300fa7310e0b
|
|
| MD5 |
c57aba36b9dab12e46d52803f129b013
|
|
| BLAKE2b-256 |
14b4b2da04515329e80485e871bd4e87b462210121b5adbb6a323c441ea1f315
|