Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Autocomplete options for python3 scripts in command line using optparse.

Project description

Description

Command line tab completion for optparse

Installation

$ sudo pip3 install optioncomplete**

Example python code

import sys
from optparse import OptionParser
from optioncomplete import autocomplete
...
parser = OptionParser()
parser.add_option("-f", "--file", dest="filename",
                  help="write report to FILE", metavar="FILE")
parser.add_option("-q", "--quiet",
                  action="store_false", dest="verbose", default=True,
                  help="don't print status messages to stdout")
autocomplete(parser,sys.argv[0])
(options, args) = parser.parse_args()

Installation and usage in command line

Optioncomplete youtube

Project details


Release history Release notifications

This version

2.7

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for optioncomplete, version 2.7
Filename, size File type Python version Upload date Hashes
Filename, size optioncomplete-2.7.tar.gz (3.6 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page