Files
warewulf/cmd/wwctl/main.go
WestleyR 705b321f80 Better error handling for some of wwctl commands
Better error handling, also prints a stack trace for `wwctl` if
`--debug` flag is used.
2021-09-10 21:18:45 -07:00

22 lines
319 B
Go

package main
import (
"fmt"
"os"
"github.com/hpcng/warewulf/internal/app/wwctl"
)
func main() {
root := wwctl.GetRootCommand()
err := root.Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "%s: %s\n", os.Args[0], err)
if wwctl.DebugFlag {
fmt.Printf("\nSTACK TRACE: %+v\n", err)
}
os.Exit(255)
}
}