gocliselect

package module
v0.0.0-...-5229957 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: MIT Imports: 4 Imported by: 0

README

Golang CLI Select (with vim key movement)

This is a fork of gocliselect with the only difference being that the vim keys are used to go up and down instead of the arrow keys.

IMPORTANT FOR WHEN USING: you have to press shift+h/j when moving up and down.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Menu struct {
	Prompt    string
	CursorPos int
	MenuItems []*MenuItem
}

func NewMenu

func NewMenu(prompt string) *Menu
func (m *Menu) AddItem(option string, id string) *Menu

AddItem will add a new menu option to the menu list

func (m *Menu) Display() string

Display will display the current menu options and awaits user selection It returns the users selected choice

type MenuItem struct {
	Text    string
	ID      string
	SubMenu *Menu
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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