diff --git a/source/commandline.go b/source/commandline.go index 8b654e59371f4ef087f807c01c64f3def4f78cfd..86f0fe3f0a1db917430fd2f249e5d4e249d9861e 100644 --- a/source/commandline.go +++ b/source/commandline.go @@ -214,6 +214,11 @@ func executeCommand() { version, err := getVersion() if err != nil { + + if arguments.Print.ExitCode { + os.Exit(10) + } + _, err := fmt.Fprintf(os.Stderr, "Error: %s\n", err) if err != nil { fmt.Printf("Error: %s\n", err) @@ -266,8 +271,8 @@ func executeCommand() { err = writeVersion(newVersion) if err != nil { - if activeCommand.Name == "auto" || activeCommand.Name == "predict" || activeCommand.Name == "print" { - if arguments.Auto.ExitCode || arguments.Predict.ExitCode || arguments.Print.ExitCode { + if activeCommand.Name == "auto" || activeCommand.Name == "predict" { + if arguments.Auto.ExitCode || arguments.Predict.ExitCode { os.Exit(10) } }