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

Known issues

This is the alpha version of the xontrib-argcomplete and the proof of concept. It was tested on Ubuntu+Conda+Xonsh and on Mac.

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

Uploaded Source

Built Distribution

xontrib_argcomplete-0.0.4-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xontrib-argcomplete-0.0.4.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.4.tar.gz
Algorithm Hash digest
SHA256 57d43a05577f7e2884c20d8ad5d02b1714c9e5fef43a237f27fd4655bd963720
MD5 c3b6d050966c28279582c0b76d207b89
BLAKE2b-256 25ab70ed9d73f6e409fa90a8f6c7cdd9508940e07789adeedcabdb1bea079b83

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xontrib_argcomplete-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 3.7 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c6a5058096fff2b3ac60e956a618e3f014fa07ca8b60fdcdf24d3d0873303b5a
MD5 7eba916b8538648c5579df1d2bbdc938
BLAKE2b-256 baa3830a9f6e274566c960eb28ad1b57b52c99fb22304827c8ae5ac5dc2ce28d

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