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
File details
Details for the file xontrib-argcomplete-0.2.2.tar.gz
.
File metadata
- Download URL: xontrib-argcomplete-0.2.2.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4bd9b3444503d8c8ffa11371b35024f590377b8d3d0b8d16317b8cc1effd0849 |
|
MD5 | 882a03e2eb1526b616e1d579112c9d21 |
|
BLAKE2b-256 | e35ee13382b41ddc3bfdb5597e09df9816c3779005b50d481357c4dbac0dd330 |
File details
Details for the file xontrib_argcomplete-0.2.2-py3-none-any.whl
.
File metadata
- Download URL: xontrib_argcomplete-0.2.2-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09762c60e4a8e9c79a52325cd91b181c1ae10e0c657da7567bd875d23199474c |
|
MD5 | 8328cbdbb6348381421709427ff8dc67 |
|
BLAKE2b-256 | 31273a88d8fd67d74ff7991042aa350be2bf5b00ee382f837923b5b4db3de9bc |