Argcomplete support for python and xonsh scripts in xonsh shell.
Project description
Argcomplete support for python and xonsh scripts in xonsh shell.
If you like the idea click ⭐ on the repo and stay tuned by watching releases.
Screenshot made with xontrib-prompt-bar and Konsole.
Install
xpip install xontrib-argcomplete
echo 'xontrib load argcomplete' >> ~/.xonshrc
# Reload xonsh
Usage
Before usage you must add the argcomplete support to your script. The PYTHON_ARGCOMPLETE_OK
marker should be found in the first 10 lines of the file.
The argcomplete xonsh completer will be activated with this cases:
python script.py
./script.py
./path/script.py
xonsh script.xsh
./script.xsh
./path/script.xsh
# scripts without extension should have "env python" or "env xonsh" or path to python/xonsh in the shebang
./script
script # script should be found in $PATH
Example
xpip install xontrib-argcomplete
xontrib load argcomplete
cd /tmp && git clone https://github.com/anki-code/xontrib-argcomplete
cd xontrib-argcomplete/tests
python proto.py <Tab> # Suggestions: --help --proto -h
./proto.py --proto tt<Tab> # Suggestions: http https
./proto.xsh --proto tt<Tab> # Suggestions: http https
./proto --proto tt<Tab> # Suggestions: http https
$PATH.append($PWD)
proto --proto tt<Tab> # Suggestions: http https
Known issues
Windows is not supported. PRs are welcome!
Development
- To switch on the debug mode run
$XONTRIB_ARGCOMPLETE_DEBUG = True
. - Argcomplete environment variables
- Argcomplete documentation
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.3.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa16647ea47e2a02e9af0c0240e02d328abe155499d173d2ab1c1d0554fe7d1e |
|
MD5 | 585286ea90b8e7cfe74658cf8417dd00 |
|
BLAKE2b-256 | b8308bc003878794859e384a482841da1e583311575fce5c4672c9e5a7ec74fc |
Close
Hashes for xontrib_argcomplete-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4d80b25e7e78d795fa9b1e2f290f12b26ffd7cca4dc3c44d1a0c32b11a1aa41 |
|
MD5 | 135ae5adcd7d4d6c7d674474b84a08d9 |
|
BLAKE2b-256 | ae753de912d5b4ff424c1c9a72265dfb57194216d30cd436b935d9fdd0a0c62d |