Open afbjorklund opened 1 year ago
Here is a small test program, to compare the text user interface frameworks:
package main
import (
"fmt"
"github.com/lima-vm/lima/pkg/uiutil"
)
func main() {
ok, err := uiutil.Confirm("Everything ok?", true)
if err != nil {
panic("error")
}
fmt.Printf("%v\n", ok)
options := []string{"one", "two", "three"}
ans, err := uiutil.Select("Favorite number?", options)
if err != nil {
panic("error")
}
fmt.Printf("%v\n", ans)
}
https://github.com/AlecAivazis/survey
35 lines of code (d1f546cfb12e6de71f13ca9de3d72b031a1de1fc)
https://github.com/charmbracelet/bubbletea
158 lines of code (76b4d9a9cb607a97c17c41f0e6092fbe4cd20268)
New library in 2023: https://github.com/charmbracelet/huh
Slightly more suitable interface elements, compared with above:
Description
https://github.com/AlecAivazis/survey/commit/160123ed7175f77bc8625b59c44b8dc03f5333e3
Might want to look for a replacement, or use a different / maintained fork of the library.
https://github.com/AlecAivazis/survey/network
https://github.com/AlecAivazis/survey#readme