manifoldco / promptui

Interactive prompt for command-line applications

Home Page:https://www.manifold.co

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature: Allow checkbox in select

rubiin opened this issue · comments

So I am building a cli which allows user to select multiple items and run some operation on them. How can we achieve this ?

I'm also interested in this

I've put together a spike of this, to prove the basic concept.

multi-select

Is there interest in adding this feature in principal? Or is this best left in our own fork?

package main

import (
	"fmt"

	"github.com/manifoldco/promptui"
)

func main() {
	prompt := promptui.MultiSelect{
		Label: "Select Day",
		Items: []string{"Monday", "Tuesday", "Wednesday", "Thursday", "Friday",
			"Saturday", "Sunday"},
	}

	_, result, err := prompt.Run()

	if err != nil {
		fmt.Printf("Prompt failed %v\n", err)
		return
	}

	fmt.Printf("You chose %q\n", result)
}

this is alternative
https://github.com/AlecAivazis/survey

that looks way better for my project, thanks