You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With a recent version of Cobra duplicate output is printed when unknown flags are passed:
package main
import"github.com/spf13/cobra"funcmain() {
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:
The text was updated successfully, but these errors were encountered:
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
With a recent version of Cobra duplicate output is printed when unknown flags are passed:
Running
cobratest --test
prints: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:
The text was updated successfully, but these errors were encountered: