fix(cli): exit 2 for every rejected value, not 1 in some commands

config default-product, config profile (unknown action, missing name, --port out of range), update --version, an invalid snapshot name, an invalid az setup container name and an unusable --persist path returned 1, the code for a command that ran and failed. They now return 2 like every other rejected value. A persist directory that cannot be created is still 1.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
This commit is contained in:
Hector Ventura committed 2026-10-11 09:52:50 -05:00
1 parent 97eaa5e820
commit 8ae0a898ed
15 files changed
+105 -32

No files matched your search

@@ -120,8 +120,9 @@ public class AzSetupCommand implements Callable<Integer> {
try {
flociAzDir = InstanceState.dir(stateRoot, ProductProfile.AZ, cloud);
} catch (IllegalArgumentException e) {
// A container name that cannot be used: the same exit code as any other bad argument.
printer.error(e.getMessage());
return 1;
return ExitCode.USAGE;
}
try {
return reset ? reset(printer, flociAzDir, cloud) : setup(printer, flociAzDir, cloud);