Skip to content

samluiz/goselcli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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