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

fix: exit error code on arg parse failure #112

Merged
merged 2 commits into from
Mar 21, 2024

Conversation

dsherret
Copy link
Member

Closes #108

@dsherret dsherret requested a review from bartlomieju March 21, 2024 03:50
@@ -21,9 +21,9 @@ impl ShellCommand for ExitCommand {
let result = match execute_exit(context.args) {
Ok(code) => ExecuteResult::Exit(code, Vec::new()),
Err(err) => {
// even if parsing args fails `exit` always exits
// exit exits with exit code 2 on argument parse failure
Copy link
Member Author

@dsherret dsherret Mar 21, 2024

Choose a reason for hiding this comment

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

It seems the exact error code to use is not dictated, but generally exit codes for failed arg parsing is 2.

@dsherret dsherret merged commit e8f8954 into denoland:main Mar 21, 2024
4 checks passed
@dsherret dsherret deleted the fix_exit_error_code branch March 21, 2024 15:49
dsherret added a commit to denoland/deno that referenced this pull request Mar 21, 2024
* feat: implement exit status var
(denoland/deno_task_shell#110)
* feat: support input redirects
(denoland/deno_task_shell#106)
* feat: support output fd redirects for stdout and stderr
(denoland/deno_task_shell#111)
* feat: support parsing fd redirects
(denoland/deno_task_shell#107)
* fix: exit error code on arg parse failure
(denoland/deno_task_shell#112)

Closes #22989
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.

Failure to parse exit command args should return 2 exit code
2 participants