diff options
| author | demo <demo@antix1> | 2026-05-28 21:57:02 -0400 |
|---|---|---|
| committer | demo <demo@antix1> | 2026-05-28 21:57:02 -0400 |
| commit | 7be78f5f9952390c5992e2409edc879ec3367be9 (patch) | |
| tree | 74870f78fef4b6eb74f239d15c0ae9731236c68c | |
| parent | 670f8051c5383bc72c4b3e4c07bb5562f83c41be (diff) | |
feat: replicate simple example from urfave docs
| -rw-r--r-- | main.go | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -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) + } } |
