summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordemo <demo@antix1>2026-05-28 21:57:02 -0400
committerdemo <demo@antix1>2026-05-28 21:57:02 -0400
commit7be78f5f9952390c5992e2409edc879ec3367be9 (patch)
tree74870f78fef4b6eb74f239d15c0ae9731236c68c
parent670f8051c5383bc72c4b3e4c07bb5562f83c41be (diff)
feat: replicate simple example from urfave docs
-rw-r--r--main.go16
1 files changed, 14 insertions, 2 deletions
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)
+ }
}