39 lines
803 B
Go
39 lines
803 B
Go
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
|
|
}
|
|
}
|