goselcli

command module
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: GPL-3.0 Imports: 1 Imported by: 0

README

Go Select CLI (goselcli)

Goselcli is a dead simple go library designed to easily build simple CLI's. It's heavily inspired by https://github.com/Nexidian/gocliselect.

Installation

go get github.com/samluiz/goselcli@latest

Usage

Import the menu:
import "github.com/samluiz/goselcli/menu"
Create a new menu:
m := menu.NewMenu("Select an option!")
Add options to the menu:
m.AddOption("Option 1", "1")
m.AddOption("Option 2", "2")
m.AddOption("Option 3", "3")
m.AddOption("Option 4", "4")
m.AddOption("Option 5", "5")
Display the menu and retrieve the choice:
choice := m.Display()

println("You chose:", choice)
Output:
image

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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