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

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

./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 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.4.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

xontrib_argcomplete-0.2.4-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xontrib-argcomplete-0.2.4.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

Hashes for xontrib-argcomplete-0.2.4.tar.gz
Algorithm Hash digest
SHA256 934a6e02c05c6539bcd6d35e66777b5586f49daee1dcef46b2b1e8a26b646bee
MD5 6a316bf80c6ad0210779232b57c490e9
BLAKE2b-256 bc4c707b8d887ca559db60d5a5e61bff9cbc2dde095a15c27676e80398df09c1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xontrib_argcomplete-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 4.3 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f71c951a8f5ededed314eb43ab33718ed3e7435584992df233c43257b03fc7e8
MD5 2b558c78c9fa4282824ca47763c12cce
BLAKE2b-256 dfd5df4294e14ed5f13a0cd9bb87483165f775c11aa21c0a7558ffebcf6ad8d5

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