initial attempt at building Masonry
This commit is contained in:
38
templates/cli/cli.go
Normal file
38
templates/cli/cli.go
Normal 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
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user