if one of the args failed, exit with an error code

parent ccba1a08
......@@ -71,10 +71,12 @@ func runUpgradeCommand(cmd *cobra.Command, args []string) {
}
// proceed upgrading, if anything is upgradable
exitErr := false
platformsRefs := parsePlatformReferenceArgs(args)
for i, platformRef := range platformsRefs {
if platformRef.Version != "" {
formatter.PrintErrorMessage(("Invalid item " + args[i]))
exitErr = true
continue
}
......@@ -92,4 +94,8 @@ func runUpgradeCommand(cmd *cobra.Command, args []string) {
os.Exit(errorcodes.ErrGeneric)
}
}
if exitErr {
os.Exit(errorcodes.ErrBadArgument)
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment