src: kw_remote: Fix not failing when missing valid options #770
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before this commit, kw remote did not validate if the command had valid option, i.e., calling kw remote (without option/parameters) or calling kw remote (without valid option) did not fail, although it did not seems to have any side effect.
Now we validate if any of the options add, remove, rename, list or set default remote were passed at the end of parse_remote_options(). If not, the command fails.
Chose to validate at the end of parse_remote_options() as 1) it seems the responsability of this function and 2) it enables to make a simple unit test for this case.
Closes #728
Signed-off-by: David Tadokoro davidbtadokoro@usp.br