Adding support of kislyuk/argcomplete to xonsh.
Project description
Adding support of argcomplete to xonsh. Xonsh scripts supported.
If you like the idea click ⭐ on the repo and stay tuned by watching releases.
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
sudo cp ./proto /bin/proto && sudo chmod +x /bin/proto
proto --proto tt<Tab> # Suggestions: http https
sudo rm /bin/proto
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
Close
Hashes for xontrib-argcomplete-0.2.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7f4cc8057db00ff7da336f7e5c4706aa1d433863a05de7416c28a7d4b168b8b |
|
MD5 | 35b17e079371a14378b9efab3c81a538 |
|
BLAKE2b-256 | 61aa808c38a048b92eefd1c4c7cb4cefc3a51fc26de506c8260ab411bd495f33 |
Close
Hashes for xontrib_argcomplete-0.2.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 939c37bb5a0d423e65c87eaa4294e5daef855d66ec0b8cfd272a61e8c326fbdb |
|
MD5 | 2ed15654e3447d20ff98ad67015497b5 |
|
BLAKE2b-256 | d3e2069616f0c322b17f2e05150dc1516c54922b38362b909cd389b3999b9481 |