Skip to main content

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.

[Demo]
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

Current version supports 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


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.6.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

xontrib_argcomplete-0.2.6-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file xontrib-argcomplete-0.2.6.tar.gz.

File metadata

  • Download URL: xontrib-argcomplete-0.2.6.tar.gz
  • Upload date:
  • Size: 4.5 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

Hashes for xontrib-argcomplete-0.2.6.tar.gz
Algorithm Hash digest
SHA256 c427d2214250771a4710c8c80093030a30e5ddc2195ab05025968644e828a85a
MD5 bdb78b7688c135c6f0138f5d2d4331c1
BLAKE2b-256 1e9b55521a89b21ff405c37cd059f37d7945d4c8b849584dda59630049251191

See more details on using hashes here.

File details

Details for the file xontrib_argcomplete-0.2.6-py3-none-any.whl.

File metadata

  • Download URL: xontrib_argcomplete-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 4.5 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

Hashes for xontrib_argcomplete-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 3a3b94af6ada81dcb5ed9a66a28c02f9a376aeeecc7e527aac4313933f92407f
MD5 005f3fd04d58864eef424d5bf0730043
BLAKE2b-256 0b76f25e5b6962538890698eb2f1d758f1d4a1228d438d6effd708dc6a540ec8

See more details on using hashes here.

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