-
Notifications
You must be signed in to change notification settings - Fork 170
refactor: options parsing #333
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
Conversation
grant
left a comment
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.
Thanks. Looks good.
I think there are some parts where we can simplify the implementation and SLOCs while keeping the same behavior. I've added some comments.
8de4965 to
e2c0f74
Compare
grant
left a comment
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.
Small requested changes, approved.
| '--port', | ||
| '1234', | ||
| '--target=helloWorld', | ||
| '--signature-type', | ||
| 'cloudevent', | ||
| '--source=/source', |
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.
nit: we're mixing using and = for arguments. Can we choose one (= seems cleaner)? Here and elsewhere.
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.
This was intentional to make sure we get test coverage for both syntax options. Alternatively I could have split this into two tests cases for --this case and --this=case. But I thought this was a bit more terse.
This commit refactors the logic for parsing CLI flags and env vars into a separate module and adds unit tests.
e2c0f74 to
382642a
Compare
This commit refactors the logic for parsing CLI flags and env vars into a separate module and adds unit tests.