chooseui

package
v0.0.0-...-6c5518b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2023 License: GPL-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package chooseui presents a simple console-based UI.

The user-interface is constructed with an array of strings, and will allow the user to choose one of them. The list may be filtered, and the user can cancel if they wish.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChooseUI

type ChooseUI struct {

	// The items the user will choose from.
	Choices []string
	// contains filtered or unexported fields
}

ChooseUI is the structure for holding our state.

func New

func New(choices []string) *ChooseUI

New creates a new UI, allowing the user to select from the available options.

func (*ChooseUI) Choose

func (ui *ChooseUI) Choose() string

Choose launches our user interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL