chooseui

package
v0.0.0-...-bb867e0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 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.

func (*ChooseUI) SetupKeyBinding

func (ui *ChooseUI) SetupKeyBinding()

SetupKeyBinding installs the global captures, and list-specific keybindings.

func (*ChooseUI) SetupUI

func (ui *ChooseUI) SetupUI()

SetupUI configures the UI.

Jump to

Keyboard shortcuts

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