-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
TC: Use switch case to simplify flag conversion and avoid multiple if statements #9507
Conversation
21f5165
to
c56c579
Compare
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.
Honestly i don't see the need to use a static one-use map for a simple action like this. There is no benefits to this, no performance gain or anything. Would've made some sense in terms of maintainability if there were a lot of such supp args, but for just four, a couple if statements don't hurt, rather I'd say is better. Probably a better option would be using switch instead (even if the list grows to say 100, a switch statement is far better than a clever use of map. simplicity 😉)
…ents Signed-off-by: ThedosiouTh <[email protected]>
Signed-off-by: ThedosiouTh <[email protected]>
Signed-off-by: ThedosiouTh <[email protected]>
Signed-off-by: ThedosiouTh <[email protected]>
71da899
to
115ac6d
Compare
@debdutdeb I understand your way of thinking. Thanks for the review. 😃 |
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.
looks good to me
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.
LGTM
What I did
I used a map to remove multiple if statements from the code and make it easier to add new argument conversions.
Also, I added missing tests for
-v
and--verbose
.Related issue
There are no related issues.