Skip to content

Conversation

@matthewrobertson
Copy link
Member

This commit refactors the logic for parsing CLI flags and env vars into a separate module and adds unit tests.

Copy link
Contributor

@grant grant left a 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.

@matthewrobertson matthewrobertson force-pushed the refactor-options branch 3 times, most recently from 8de4965 to e2c0f74 Compare September 23, 2021 19:22
Copy link
Contributor

@grant grant left a 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.

Comment on lines +61 to +66
'--port',
'1234',
'--target=helloWorld',
'--signature-type',
'cloudevent',
'--source=/source',
Copy link
Contributor

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.

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 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.
@matthewrobertson matthewrobertson merged commit 5856009 into master Sep 23, 2021
@matthewrobertson matthewrobertson deleted the refactor-options branch December 7, 2021 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants