Something went wrong. Try again.
Simple, intuitive CLI framework for Go pkg.go.dev/go.followtheprocess.codes/cli
Something went wrong. Try again.
123456789101112131415161718192021222324252627package main
import ( "context" "fmt" "time"
"go.followtheprocess.codes/cli")
func BuildCLI() (*cli.Command, error) { return cli.New( "cancel", cli.Short("Cancel me!"), cli.Run(func(ctx context.Context, cmd *cli.Command) error { for { select { case <-ctx.Done(): return ctx.Err() case <-time.After(1 * time.Second): fmt.Fprintln(cmd.Stdout(), "working...") } } }), )}