Skip to content

feat(cli): exit 64 for command misuse - #3

Merged
sydorovdmytro merged 1 commit into
mainfrom
dmytrosydorov/devops-1371-fix-semstat-exit-2-conflates-an-unreadable-version-with-a
Aug 20, 2026
Merged

feat(cli): exit 64 for command misuse#3
sydorovdmytro merged 1 commit into
mainfrom
dmytrosydorov/devops-1371-fix-semstat-exit-2-conflates-an-unreadable-version-with-a

Conversation

@sydorovdmytro

Copy link
Copy Markdown
Contributor

Exit 2 meant both "I could not read this version" and "you called me wrong". A caller that accepts 2 from parse or type as a verdict on its input would read a renamed subcommand or a changed argument count as that verdict and stay green on the wrong answer.

0, 1 and 2 stay as grep and diff use them. Misuse takes EX_USAGE from sysexits, since that family has no number for it and overloads 2 instead, and its distance from the rest says it is not an answer.

@sydorovdmytro
sydorovdmytro requested a review from a team as a code owner August 20, 2026 12:45
Exit 2 meant both "I could not read this version" and "you called me
wrong". A caller that accepts 2 from parse or type as a verdict on its
input would read a renamed subcommand or a changed argument count as
that verdict and stay green on the wrong answer.

An option where a version was expected is the same mistake, and the
usual cause is an unquoted "$tag" that expanded to nothing, so it is
misuse too rather than an unreadable version.

0, 1 and 2 stay as grep and diff use them. Misuse takes EX_USAGE from
sysexits, since that family has no number for it and overloads 2
instead, and its distance from the rest says it is not an answer.
@sydorovdmytro
sydorovdmytro force-pushed the dmytrosydorov/devops-1371-fix-semstat-exit-2-conflates-an-unreadable-version-with-a branch from 38942db to 6f9fb44 Compare August 20, 2026 12:54
@sydorovdmytro
sydorovdmytro merged commit 99de36c into main Aug 20, 2026
6 checks passed
@sydorovdmytro
sydorovdmytro deleted the dmytrosydorov/devops-1371-fix-semstat-exit-2-conflates-an-unreadable-version-with-a branch August 20, 2026 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant