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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
⌂ 换网址