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

Help returns exit 0 code #389

Merged
merged 2 commits into from
May 28, 2024
Merged

Help returns exit 0 code #389

merged 2 commits into from
May 28, 2024

Conversation

pahatz
Copy link
Contributor

@pahatz pahatz commented May 24, 2024

Related issue(s) and PR(s)
This PR closes #313

Description
Currently sda-cli does not return the correct exit code when we run help or -h (exit 1)
It should return exit code 0 except the case of asking for a wrong subcommand.

How to test
Run:

./sda-cli help
./sda-cli -h
./sda-cli help list
./sda-cli help inexistent_command

followed each time by:

echo $?

to get the exit code of the previous command.

@pahatz pahatz requested a review from a team May 24, 2024 14:12
@codecov-commenter
Copy link

codecov-commenter commented May 24, 2024

Codecov Report

Attention: Patch coverage is 0% with 9 lines in your changes are missing coverage. Please review.

Project coverage is 40.48%. Comparing base (19233e3) to head (db980ed).
Report is 6 commits behind head on main.

Files Patch % Lines
main.go 0.00% 9 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #389      +/-   ##
==========================================
- Coverage   40.55%   40.48%   -0.08%     
==========================================
  Files          11       11              
  Lines        1536     1539       +3     
==========================================
  Hits          623      623              
- Misses        834      837       +3     
  Partials       79       79              
Flag Coverage Δ
unittests 40.48% <0.00%> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@MalinAhlberg MalinAhlberg left a comment

Choose a reason for hiding this comment

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

Well done, and thanks for the nice instructions! I think there is one more case where exit 1 should be returned, made a comment. Apart from that, I'm ready to approve.

@pahatz pahatz force-pushed the help-return-fix branch from b5e5a0e to db980ed Compare May 27, 2024 13:19
@pahatz pahatz added this pull request to the merge queue May 28, 2024
Merged via the queue into main with commit 433b631 May 28, 2024
6 checks passed
@pahatz pahatz deleted the help-return-fix branch May 28, 2024 07:34
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.

sda-cli help or sda-cli -h etc, should return exit 0
5 participants