esxlib/cmd/vmctl/main.go

31 lines
524 B
Go
Raw Normal View History

2023-06-22 05:16:40 +00:00
package main
import (
2023-06-24 19:57:08 +00:00
"log"
2023-06-22 05:16:40 +00:00
"os"
2023-06-24 19:57:08 +00:00
"github.com/urfave/cli/v2"
2023-06-22 05:16:40 +00:00
)
2023-06-24 19:57:08 +00:00
const appName = "vmctl"
2023-06-22 05:16:40 +00:00
2023-06-24 19:57:08 +00:00
func commandNotFound(c *cli.Context, command string) {
log.Fatalf("'%s' is not a %s command. See '%s --help'.",
command, c.App.Name, c.App.Name)
2023-06-22 05:16:40 +00:00
}
func main() {
2023-06-24 19:57:08 +00:00
app := cli.NewApp()
app.Name = appName
app.Description = "vm management tool for esx"
app.Version = "v1.0"
2023-06-22 05:16:40 +00:00
2023-06-24 19:57:08 +00:00
app.Flags = globalFlags
app.Commands = commands
app.CommandNotFound = commandNotFound
2023-06-22 05:16:40 +00:00
2023-06-24 19:57:08 +00:00
if err := app.Run(os.Args); err != nil {
log.Fatal(err)
2023-06-22 05:16:40 +00:00
}
}