From acabe2c0dac61d562b299d0dbd3480e120eb3b4b Mon Sep 17 00:00:00 2001 From: Jelloeater Date: Thu, 22 Aug 2024 22:35:03 -0400 Subject: [PATCH] Starting on CLI Base --- go.mod | 8 ++++++++ go.sum | 8 ++++++++ main.go | 19 +++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 go.sum diff --git a/go.mod b/go.mod index 6f612f2..6f58d55 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,11 @@ module stampy go 1.18 + +require github.com/urfave/cli/v2 v2.27.4 + +require ( + github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect + github.com/russross/blackfriday/v2 v2.1.0 // indirect + github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..46bd4d8 --- /dev/null +++ b/go.sum @@ -0,0 +1,8 @@ +github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/urfave/cli/v2 v2.27.4 h1:o1owoI+02Eb+K107p27wEX9Bb8eqIoZCfLXloLUSWJ8= +github.com/urfave/cli/v2 v2.27.4/go.mod h1:m4QzxcD2qpra4z7WhzEGn74WZLViBnMpb1ToCAKdGRQ= +github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4= +github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM= diff --git a/main.go b/main.go index 7905807..6566bc6 100644 --- a/main.go +++ b/main.go @@ -1,5 +1,24 @@ package main +import ( + "fmt" + "log" + "os" + + "github.com/urfave/cli/v2" +) + func main() { + app := &cli.App{ + Name: "greet", + Usage: "fight the loneliness!", + Action: func(*cli.Context) error { + fmt.Println("Hello friend!") + return nil + }, + } + if err := app.Run(os.Args); err != nil { + log.Fatal(err) + } }