Skip to main content

Choose Options using a CLI Checkbox Menu

Project description

CHOOSE OPTIONS

A simple CLI checkbox menu interface for choosing options.

img

Takes a list of options as an argument and returns a list of selected items from that list.

Options are chosen by entering their corresponding number (including specifying ranges in the form 1..5 or 1-5), or using globbing to match option strings.

INSTALLATION

pip install chopt

CLI USAGE

usage: chopt [-h] options [options ...]

Create a checkbox menu from a list of options.

positional arguments:
  options     Options for the menu.

optional arguments:
  -h, --help  show this help message and exit

PYTHON USAGE

from chopt import chopt

my_list = [ 'item1', 'item2', 'item3' ]

chosen = chopt(my_list)

some_interesting_function(chosen)

EXAMPLES

chopt $(ls ~/src/chopt)

chopt $(tail -n 10 /usr/share/dict/words)

chopt options{1..12}

Project details


Download files

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

Files for chopt, version 0.0.5
Filename, size File type Python version Upload date Hashes
Filename, size chopt-0.0.5-py3-none-any.whl (4.4 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size chopt-0.0.5.tar.gz (3.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page