feat(cli): exit 64 for command misuse - #3
Merged
sydorovdmytro merged 1 commit intoAug 20, 2026
Conversation
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
force-pushed
the
dmytrosydorov/devops-1371-fix-semstat-exit-2-conflates-an-unreadable-version-with-a
branch
from
August 20, 2026 12:54
38942db to
6f9fb44
Compare
sydorovdmytro
deleted the
dmytrosydorov/devops-1371-fix-semstat-exit-2-conflates-an-unreadable-version-with-a
branch
August 20, 2026 12:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.