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
Windows is not supported. PRs are welcome!
Development
- To switch on the debug mode run
$XONTRIB_ARGCOMPLETE_DEBUG = True
. - Argcomplete environment variables
- Argcomplete documentation
Links
- This package is the part of ergopack - the pack of ergonomic xontribs.
- This package was created with xontrib cookiecutter template.
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.3.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e7d4d1e1fcf4d38125f4b1e3af3994e946fe0fc404383db0e25ce49be3f8eb5 |
|
MD5 | 8a08070a61721c9bd78dc3c0d436b867 |
|
BLAKE2b-256 | f73faf469fc358a674cf23b00b496f9001613a4bf407a72888370decef06d9ba |
Close
Hashes for xontrib_argcomplete-0.3.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 029c9cf3f6cdd27281e9e1d9f1dbcf49c0ef3a5981b6d4766146bfeeff773563 |
|
MD5 | a10290d0217b8b7ce86489c1d90e009a |
|
BLAKE2b-256 | 280db0b254baa8d10d299f2a9ad0271e94db5615d75be6269a1c903228d81a5b |