From 7be78f5f9952390c5992e2409edc879ec3367be9 Mon Sep 17 00:00:00 2001 From: demo Date: Thu, 28 May 2026 21:57:02 -0400 Subject: feat: replicate simple example from urfave docs --- main.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index 437ebff..9e23ee6 100644 --- a/main.go +++ b/main.go @@ -2,12 +2,24 @@ package main import ( "context" + "fmt" + "log" "os" "github.com/urfave/cli/v3" ) func main() { - cmd := new(cli.Command) - cmd.Run(context.Background(), os.Args) + cmd := new(cli.Command{ + Name: "boom", + Usage: "make an explosive entrance", + Action: func(context.Context, *cli.Command) error { + fmt.Println("Boom! I say!") + return nil + }, + }) + + if err := cmd.Run(context.Background(), os.Args); err != nil { + log.Fatal(err) + } } -- cgit v1.2.3