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 click ⭐ on the repo and stay tuned by watching releases.

Install

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

Usage

For example create proto.py:

#!/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

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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: xontrib-argcomplete-0.0.7.tar.gz
  • Upload date:
  • Size: 2.8 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.7.tar.gz
Algorithm Hash digest
SHA256 3782fb8d1560ebff6dd149541ee797e0ecee5a5eb217053809ae0389f369935f
MD5 838e86f804b2d6e6c144143387417996
BLAKE2b-256 442bc7348c19932c4c0dabb2163235b4d336a698a2ab83996fc23c18a0e76940

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xontrib_argcomplete-0.0.7-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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 30ef4ffa1b611f799d2d7e50b1528a0c9904a6b2feda6a62238602d5bfd25425
MD5 a3ab826855203241943ed41d2b1bda92
BLAKE2b-256 3b805fe9cf522d69175048ecaef456ef2128594d3eceb46721209a5c39518934

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