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
./script # shebang should has "env python" or "env xonsh"
script # script should be found in $PATH and shebang should has "env python" or "env xonsh"
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.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d11c808514f59b4b77f4ad3d48a0ba9026a1f480c7155ad973e306c487e94b14 |
|
MD5 | ffacfff62280bb75e9307242e7d88c76 |
|
BLAKE2b-256 | 584428b369c557b67425c9605f189cd4d546bd0920a503c793fc3c23f59b390b |
Hashes for xontrib_argcomplete-0.2.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37fab30aac56e2e8d9df0b10c6473275ddc0a439db1eee80e8438a7a2d8b1fa6 |
|
MD5 | 4f92ab6e20e625b27f9e7f1f1378d723 |
|
BLAKE2b-256 | 24d37f36f6b90320b3e5e3c5a1a00fdb42775eabfc2859e6edcf6ad352b314cd |