Skip to content

Update exit codes in CLI operations #66

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

Merged
merged 1 commit into from
Aug 11, 2024
Merged

Conversation

catatsuy
Copy link
Owner

@catatsuy catatsuy commented Aug 11, 2024

This pull request includes several changes to the internal/cli/cli.go file and its corresponding tests to improve error handling and consistency in exit codes. The most important changes involve updating exit codes, refining error handling in the Run method, and enhancing test cases to reflect these updates.

Error Handling and Exit Codes:

  • Updated ExitCodeParseFlagError and ExitCodeFail constants to use distinct values (2 instead of 1). (internal/cli/cli.go)
  • Refined error handling in the Run method by separating the assignment and checking of errors for replaceProcess. (internal/cli/cli.go) [1] [2]

Test Enhancements:

  • Added expectedCode to test cases to check for the correct exit codes. (internal/cli/cli_test.go)
  • Updated test cases to use the new exit code values (2 instead of 1). (internal/cli/cli_test.go) [1] [2] [3] [4]
  • Removed unnecessary blank lines in test functions for better readability. (internal/cli/cli_test.go) [1] [2]

@catatsuy catatsuy merged commit 923ac23 into main Aug 11, 2024
5 checks passed
@catatsuy catatsuy deleted the feature-refactor-exit-code branch August 11, 2024 07:19
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