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
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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 473620db5e3880e6dad9448243bff0cd1256107ef93887c4671fb296d99a6c46 |
|
MD5 | 4cbe002db5b74fe10d1ea671e4f4a597 |
|
BLAKE2b-256 | ccf751c271e41f650e8e2cb5cedc8d596689a61fae84804c27f9a2ed620dcff7 |
Close
Hashes for xontrib_argcomplete-0.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 241906d4762bcbe5c75bbb069ef26d92a885d9ebbfd240293ae0a622351f58a6 |
|
MD5 | 1acfaeadb24aa6af45a03b89eb8193a8 |
|
BLAKE2b-256 | 6c44ebfea5e6dfa7f86c85345c216a3e8fc225b47613e10a2e3865795add2981 |