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

@@ -39,9 +39,23 @@ class ExitCodeTableTest {
"2, completion fish",
"2, status --json --no-such-flag",
"2, config profile show ../escape",
// Accepted by the command line, rejected by the command with 1.
"1, update --version not-a-version",
"1, config profile create demo --port 0",
// Accepted by the command line, rejected by the command: the same code.
"2, update --version not-a-version",
"2, update --check --version not-a-version",
"2, config profile create demo --port 0",
"2, config profile create demo --port 70000",
"2, config profile bogus",
"2, config profile show",
"2, config profile create",
"2, config profile edit",
"2, config profile delete",
"2, config default-product nope",
"2, snapshot save a/b",
"2, snapshot load ..",
"2, snapshot delete a/b",
"2, gcp snapshot save a/b",
"2, az setup --container ../escape",
// It ran and the answer is no.
"1, config profile show no-such-profile",
"1, config profile edit no-such-profile",
"1, config validate -f no-such-compose-file.yml",