Skip to main content

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

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"

The PYTHON_ARGCOMPLETE_OK marker should be found in the first 10 lines of the file.

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

Files or paths with spaces in names is not supported now and completion will not be activated. PRs are welcome!

Development

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xontrib-argcomplete-0.2.1.tar.gz (4.1 kB view hashes)

Uploaded Source

Built Distribution

xontrib_argcomplete-0.2.1-py3-none-any.whl (4.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page