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

Duplicate "unknown flag" output #426

Closed
akupila opened this issue Apr 27, 2017 · 1 comment
Closed

Duplicate "unknown flag" output #426

akupila opened this issue Apr 27, 2017 · 1 comment
Labels
area/lib Methods and functions that exist in the cobra library and consumed by users kind/bug A bug in cobra; unintended behavior

Comments

@akupila
Copy link

akupila commented Apr 27, 2017

With a recent version of Cobra duplicate output is printed when unknown flags are passed:

package main

import "github.com/spf13/cobra"

func main() {
	cmd := &cobra.Command{
		Use: "cobratest",
	}
	cmd.Execute()
}

Running cobratest --test prints:

unknown flag: --test
Usage of cobratest:
  -h, --help   help for cobratest
Error: unknown flag: --test
Usage:

I did some digging and found that this was introduced in b655df6. With a version of cobra prior to this the output for the same command is:

Error: unknown flag: --test
Usage:

@n10v n10v added area/lib Methods and functions that exist in the cobra library and consumed by users kind/bug A bug in cobra; unintended behavior labels Apr 27, 2017
@n10v n10v closed this as completed in 3d7bff8 Apr 27, 2017
@n10v
Copy link
Collaborator

n10v commented Apr 27, 2017

Thank you for your bug report and sorry for the inconvenience! I fixed it.
Please update cobra and its dependencies:go get -u github.com/spf13/cobra

n10v added a commit to gohugoio/hugo that referenced this issue Apr 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/lib Methods and functions that exist in the cobra library and consumed by users kind/bug A bug in cobra; unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants