Files
matchbox/bootcfg/cli/error.go
2016-03-21 12:52:48 -07:00

21 lines
284 B
Go

package cmd
import (
"fmt"
"os"
)
// CLI Tool errors
// http://tldp.org/LDP/abs/html/exitcodes.html
const (
ExitSuccess = iota
ExitError
ExitBadConnection
ExitBadArgs = 128
)
func exitWithError(code int, err error) {
fmt.Fprintln(os.Stderr, "Error: ", err)
os.Exit(code)
}