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
You should add argcomplete support to your script before usage. 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 support Linux/Mac only.
Files or paths with spaces in names is not supported now and completion will not be activated. PRs are welcome!
Development
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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4bd9b3444503d8c8ffa11371b35024f590377b8d3d0b8d16317b8cc1effd0849 |
|
MD5 | 882a03e2eb1526b616e1d579112c9d21 |
|
BLAKE2b-256 | e35ee13382b41ddc3bfdb5597e09df9816c3779005b50d481357c4dbac0dd330 |
Close
Hashes for xontrib_argcomplete-0.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09762c60e4a8e9c79a52325cd91b181c1ae10e0c657da7567bd875d23199474c |
|
MD5 | 8328cbdbb6348381421709427ff8dc67 |
|
BLAKE2b-256 | 31273a88d8fd67d74ff7991042aa350be2bf5b00ee382f837923b5b4db3de9bc |