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

Fix panic when parsing unknown flag followed by empty argument #173

Merged
merged 1 commit into from Aug 31, 2018

Conversation

shomron
Copy link

@shomron shomron commented Jun 29, 2018

Reproducing the panic:

fset := pflag.NewFlagSet("", pflag.ContinueOnError)
fset.ParseErrorsWhitelist.UnknownFlags = true
fset.Parse([]string{"--unknown", ""})

Signed-off-by: Oren Shomron <shomron@gmail.com>
@CLAassistant
Copy link

CLAassistant commented Jun 29, 2018

CLA assistant check
All committers have signed the CLA.

@shomron
Copy link
Author

shomron commented Aug 29, 2018

Ping. Anyone had a chance to look at this?

shomron added a commit to shomron/cobra that referenced this pull request Aug 29, 2018
Signed-off-by: Oren Shomron <shomron@gmail.com>
shomron added a commit to shomron/cobra that referenced this pull request Aug 29, 2018
Signed-off-by: Oren Shomron <shomron@gmail.com>
Copy link

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

ping @eparis @spf13 ptal

@eparis eparis merged commit 298182f into spf13:master Aug 31, 2018
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

4 participants