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
Current version supports Linux/Mac only.
Files or paths with spaces in names is not supported now and completion will not be activated. 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
Hashes for xontrib-argcomplete-0.2.7.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ab81668e0aad74f1a1fa20ae39bf7e43d29a54fa59b11da6a92c8ea8d791df9 |
|
MD5 | 3895554b98eb474c351d3b3fa36af0b5 |
|
BLAKE2b-256 | 5643a5070b6699504e0b25b6d555cd88cfd7faccee822f398d14d6ec8d7a80a1 |
Hashes for xontrib_argcomplete-0.2.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2e6112eb37b24244e9705233639d9fc4d33c2c66063918422b98d53f41b8297 |
|
MD5 | 72ac4f385090b55ddc0aadda555a4e34 |
|
BLAKE2b-256 | ea7513d44cc4347798f08f38311679f467730754e0c9e10c41363560961fdc5b |