-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add flags parser #77
Add flags parser #77
Conversation
Codecov Report
@@ Coverage Diff @@
## master #77 +/- ##
============================================
- Coverage 65.53% 65.01% -0.52%
Complexity 406 406
============================================
Files 80 81 +1
Lines 1381 1392 +11
Branches 134 135 +1
============================================
Hits 905 905
- Misses 443 454 +11
Partials 33 33
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the comment I made, LGTM! Thank you
|
||
import com.google.common.collect.ImmutableSet; | ||
|
||
public class Flag { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could add a javadoc comment as follows:
Represents the string consisting of a dash followed by an alphabet such as "-m" included in the user's command.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
other than the comment i made the rest looks good!
@@ -20,14 +21,16 @@ public ViewCommand parse(String args) throws ParseException { | |||
String.format(MESSAGE_INVALID_COMMAND_FORMAT, ViewCommand.MESSAGE_USAGE)); | |||
} | |||
|
|||
Flag commandFlag = ParserUtil.parseFlag(trimmedArgs); | |||
|
|||
String[] nameKeywords = trimmedArgs.split("\\s+"); | |||
String viewCommandOption = nameKeywords[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think can remove this line:
String viewCommandOption = nameKeywords[0];
Fixes #70
Fixes #78