Skip to content

Interactive Pipe To: The golang cli interactive workflow.

Notifications You must be signed in to change notification settings

afeiship/go-ipt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


ipt logo

go-ipt

Interactive Pipe To: The golang cli interactive workflow.

installation

go get -u github.com/afeiship/go-ipt

usage

package main

import (
	"github.com/afeiship/go-ipt"
)

func main() {
	type ColorObj struct {
		Name string
		Hex  string
	}

	opts := []ipt.Option[ColorObj]{
		{Label: "Red", Value: ColorObj{"Red", "#FF0000"}},
		{Label: "Green", Value: ColorObj{"Green", "#00FF00"}},
		{Label: "Blue", Value: ColorObj{"Blue", "#0000FF"}},
	}

	color, err := ipt.Ipt("What is your favorite color?", opts)
	if err != nil {
		panic(err)
	}
	println(color.Name, color.Hex)
}

About

Interactive Pipe To: The golang cli interactive workflow.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages