Skip to main content

Adding support of kislyuk/argcomplete to xonsh.

Project description

Adding support of kislyuk/argcomplete to xonsh.

If you like the idea of xontrib-argcomplete click ⭐ on the repo and stay tuned by watching releases.

Install

xpip install -U xontrib-argcomplete
echo 'xontrib load argcomplete' >> ~/.xonshrc
# Reload xonsh

Usage

Current version of completion is working only for commands that starts with:

  • python <path/to/python_script.py> ...
  • <path/to/python_script.py> ...

For example create proto.py with the content:

#!/usr/bin/env python
# PYTHON_ARGCOMPLETE_OK
import argparse, argcomplete
from argcomplete.completers import ChoicesCompleter

parser = argparse.ArgumentParser()
parser.add_argument("--proto").completer=ChoicesCompleter(('http', 'https', 'ssh', 'rsync', 'wss'))
argcomplete.autocomplete(parser)
args = parser.parse_args()
print('ok')

Then try completion:

python proto.py <Tab>
# Suggestions: --help --proto -h

chmod +x proto.py
./proto.py --proto tt<Tab>
# Suggestions: http https

The xontrib was tested on Ubuntu+Conda+Xonsh and on Mac+Brew+PyPi+Xonsh.

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

Uploaded Source

Built Distribution

xontrib_argcomplete-0.0.5-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xontrib-argcomplete-0.0.5.tar.gz
  • Upload date:
  • Size: 2.9 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.48.2 CPython/3.8.5

File hashes

Hashes for xontrib-argcomplete-0.0.5.tar.gz
Algorithm Hash digest
SHA256 f4a3c0c358f4cd61dc734a4a44b0bbeb53ccee169623b96050f72a9488edcd5b
MD5 0883dcf046b0016abef400a3a147d4b4
BLAKE2b-256 805d4806258b9865b4b6dd65f7f6d6962adbe4f6d39a23230b939d403bcfa704

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xontrib_argcomplete-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 3.8 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.48.2 CPython/3.8.5

File hashes

Hashes for xontrib_argcomplete-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 a85836d9942380c6b1fd5e3aa2c68106f29f6eaddce7966af9c3407417f59056
MD5 e231da65cda43ac5e9cf9c47ebd4d2fd
BLAKE2b-256 fe260f8a74222d576b49e58b24b78119dd12185dcaf601ac5886667d07c38700

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