Metadata-Version: 2.1
Name: clinterface
Version: 0.1.1.post4
Summary: Simple command line interface library
Home-page: https://github.com/josemvas/clinterface
License: LGPLv3+
Keywords: console cli prompt
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)
Classifier: Operating System :: POSIX
Requires-Python: >=3.3
Description-Content-Type: text/markdown

<!-- -*- mode: markdown -*- -->

clinterface
===========

**clinterface** is a simple command line interface library to
display tab-completion prompts and interactive menus.

Quick start
-----------

Import the module

    from clinterface import prompts

Create a default Selector instance

    selector = prompts.Selector()

or create a customized Selector instance

    selector = prompts.Selector(
        shift = 1,
        indent = 3,
        align = 2,
        margin = 1,
        pad_left = 1,
        pad_right = 1,
        radiobullet = '*',
        checkbullet = '+',
    )

Set the options and defaults from a list

    selector.set_options([
        'Monday',
        'Tuesday',
        'Wednesday',
        'Thursday',
        'Friday',
        'Saturday',
        'Sunday',
    ])
    selector.set_single_default('Friday')
    selector.set_multiple_defaults(['Friday', 'Saturday', 'Sunday'])

or alternativey set the options and defaults from a dictionary

    selector.set_options({
        'Mon':'Monday',
        'Tues':'Tuesday',
        'Wed':'Wednesday',
        'Thurs':'Thursday',
        'Fri':'Friday',
        'Sat':'Saturday',
        'Sun':'Sunday',
    })
    selector.set_single_default('Fri')
    selector.set_multiple_defaults(['Fri', 'Sat', 'Sun'])

Prompt for a single choice

    selector.set_message('Choose the best day of the week:')
    selector.single_choice()

Prompt for multiple choices

    selector.set_message('Choose the good days of the week:')
    selector.multiple_choices()


