Skip to content
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

Handle single string=>string flags without quotes #179

Merged
merged 1 commit into from Aug 21, 2018

Conversation

tamalsaha
Copy link

@tamalsaha tamalsaha commented Aug 16, 2018

OK: --f1 "a=5,6" --f2 b=3,4 --f3 "c=5,6",d=7
Not OK: --f4 c="5,6"

@tamalsaha
Copy link
Author

@eparis , this pr adds support for --f2 b=3,4 flag.

cc: @sgraham785

xref: #133 #129

@tamalsaha tamalsaha changed the title Handle single flags without quotes Handle single string=>string flags without quotes Aug 16, 2018
@tamalsaha
Copy link
Author

@eparis , if you can take a look at this, that will be great.

@@ -140,13 +140,14 @@ func TestS2SCalledTwice(t *testing.T) {
var s2s map[string]string
f := setUpS2SFlagSet(&s2s)

in := []string{"a=1,b=2", "b=3", `"e=5,6"`, `f="7,8"`}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a check that len(s2s) == len(expected) so we can't make this mistake again?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this check. PTAL

OK: --f1 "a=5,6" --f2 b=3,4 --f3 "c=5,6",d=7
Not OK: --f4 c="5,6"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants