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

Propagate an error status when a CommandLine module gets an unknown command #1004

Merged
merged 2 commits into from Jan 10, 2020

Conversation

mvidner
Copy link
Member

@mvidner mvidner commented Jan 6, 2020

prompted by the testing discussion in yast/yast-ruby-bindings#237
because I wanted to test that fix with yast2 lan unknowncommand and it still did not work

@@ -360,7 +360,7 @@ def Parse(arguments)
# translators: error message in command line interface
Error(Builtins.sformat(_("Unknown Command: %1"), command))

return { "command" => command }
return {}
Copy link
Member Author

Choose a reason for hiding this comment

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

This fix works because our caller actually obeys our API documented above

#  @return [Hash{String => Object}]  containing the command and it's option. In case of
#        error it is an empty map.

@coveralls
Copy link

coveralls commented Jan 6, 2020

Coverage Status

Coverage increased (+0.01%) to 30.03% when pulling 51789a0 on cli-unknown-is-error into 799e67f on master.

Related to bsc#1144351.

Found when testing the correct propagation of errors:
A false from a YaST client should mean an error exit code.
@mvidner mvidner merged commit 49e43ba into master Jan 10, 2020
@mvidner mvidner deleted the cli-unknown-is-error branch January 10, 2020 10:24
@yast-bot
Copy link
Contributor

✔️ Public Jenkins job #166 successfully finished
✔️ Created OBS submit request #762718

@yast-bot
Copy link
Contributor

✔️ Internal Jenkins job #64 successfully finished
✔️ Created IBS submit request #209098

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.

None yet

4 participants