ENH?: side-inform user to avoid exit codes above 127 by yarikoptic · Pull Request #92 · cli-guidelines/cli-guidelines · GitHub
Skip to content

ENH?: side-inform user to avoid exit codes above 127#92

Open
yarikoptic wants to merge 1 commit into
cli-guidelines:mainfrom
yarikoptic:enh-exit-code
Open

ENH?: side-inform user to avoid exit codes above 127#92
yarikoptic wants to merge 1 commit into
cli-guidelines:mainfrom
yarikoptic:enh-exit-code

Conversation

@yarikoptic

Copy link
Copy Markdown

More on rationale is elaborated at https://unix.stackexchange.com/a/99134/55543
and a quick possibly 'interesting' demo:

$> bash -c 'exit 256'; echo $1
0

More on rationale is elaborated at https://unix.stackexchange.com/a/99134/55543
and a quick possibly 'interesting' demo:

	$> bash -c 'exit 256'; echo $?
	0
@matu3ba

matu3ba commented Oct 24, 2023

Copy link
Copy Markdown

@yarikoptic

Copy link
Copy Markdown
Author

Return code 125, 126 and 127 are used by git bisect

that is ok, neither of them is above 127.

1 similar comment
@yarikoptic

Copy link
Copy Markdown
Author

Return code 125, 126 and 127 are used by git bisect

that is ok, neither of them is above 127.

Comment thread content/_index.md
**Return zero exit code on success, non-zero on failure.**
Exit codes are how scripts determine whether a program succeeded or failed, so you should report this correctly.
Map the non-zero exit codes to the most important failure modes.
Map the non-zero exit codes to the most important failure modes, but avoid exit codes above 127.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trying to add minimal amount of "why" to address the concern:

Suggested change

but really not sure if it should go to that detail here. May be a reference should be added instead?

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.

2 participants