mirror of
https://github.com/outbackdingo/matchbox.git
synced 2026-03-20 13:43:17 +00:00
21 lines
284 B
Go
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)
|
|
}
|