Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TODO] Create an enum for the return values of the expander and use it for internal error reporting only #157

Open
itislu opened this issue Feb 6, 2024 · 0 comments
Assignees
Labels
explanation Description of certain learnings todo There are still some things left to do
Milestone

Comments

@itislu
Copy link
Collaborator

itislu commented Feb 6, 2024

The same way as the heredoc_status enum.
This can replace the BAD_SUBSTITUTION exit code macro.

Originally posted by @itislu in #153 (comment)


These are the exit codes defined in the bash source code:

/* Values that can be returned by execute_command (). */
#define EXECUTION_FAILURE 1
#define EXECUTION_SUCCESS 0

/* Usage messages by builtins result in a return status of 2. */
#define EX_BADUSAGE	2

#define EX_MISCERROR	2

/* Special exit statuses used by the shell, internally and externally. */
#define EX_RETRYFAIL	124
#define EX_WEXPCOMSUB	125
#define EX_BINARY_FILE	126
#define EX_NOEXEC	126
#define EX_NOINPUT	126
#define EX_NOTFOUND	127

#define EX_SHERRBASE	256	/* all special error values are > this. */

#define EX_BADSYNTAX	257	/* shell syntax error */
#define EX_USAGE	258	/* syntax error in usage */
#define EX_REDIRFAIL	259	/* redirection failed */
#define EX_BADASSIGN	260	/* variable assignment error */
#define EX_EXPFAIL	261	/* word expansion failed */
#define EX_DISKFALLBACK	262	/* fall back to disk command from builtin */

Originally posted by @itislu in #153 (comment)

@itislu itislu self-assigned this Feb 6, 2024
@itislu itislu added the todo There are still some things left to do label Feb 6, 2024
@itislu itislu added this to the Expander milestone Feb 6, 2024
@itislu itislu added the explanation Description of certain learnings label Mar 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
explanation Description of certain learnings todo There are still some things left to do
Projects
None yet
Development

No branches or pull requests

1 participant