initial attempt at building Masonry

This commit is contained in:
2025-02-12 22:14:44 -07:00
commit e34da045bc
12 changed files with 187 additions and 0 deletions

38
templates/cli/cli.go Normal file
View File

@ -0,0 +1,38 @@
package main
import (
"fmt"
"github.com/urfave/cli/v2"
"os"
"time"
)
func main() {
commands := []*cli.Command{
exampleCmd(),
// call your command functions from the commands.go file
}
app := &cli.App{
Name: "ExampleApp",
Usage: "An example CLI tool",
Version: "v1.0.0",
Description: "This is an example CLI tool",
Commands: commands,
Flags: nil,
Authors: []*cli.Author{
{
Name: "Mason Payne", // Update this to your name
Email: "mason@masonitestudios.com", // Update this to your email
},
},
Copyright: fmt.Sprintf("%d Example Corp", time.Now().Year()),
UseShortOptionHandling: true,
}
err := app.Run(os.Args)
if err != nil {
fmt.Println(fmt.Errorf("error running app | %w", err))
return
}
}

20
templates/cli/commands.go Normal file
View File

@ -0,0 +1,20 @@
package main
import (
"fmt"
"github.com/urfave/cli/v2"
)
func exampleCmd() *cli.Command {
return &cli.Command{
Name: "example",
Aliases: []string{"e"},
Usage: "Run an example command",
Action: func(c *cli.Context) error {
fmt.Println("This is an example command")
return nil
},
}
}
// add commands here