mirror of https://github.com/knative/func.git
fix: bind verbose flag to root (#884)
This commit is contained in:
parent
917a8efdb2
commit
25524a1f84
|
@ -56,7 +56,6 @@ EXAMPLES
|
||||||
$ {{.Name}} invoke
|
$ {{.Name}} invoke
|
||||||
|
|
||||||
For more examples, see '{{.Name}} <command> --help'.`,
|
For more examples, see '{{.Name}} <command> --help'.`,
|
||||||
PreRunE: bindEnv("verbose"),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Environment Variables
|
// Environment Variables
|
||||||
|
@ -68,6 +67,10 @@ EXAMPLES
|
||||||
// Flags
|
// Flags
|
||||||
// persistent flags are available to all subcommands implicitly
|
// persistent flags are available to all subcommands implicitly
|
||||||
cmd.PersistentFlags().BoolP("verbose", "v", false, "print verbose logs ($FUNC_VERBOSE)")
|
cmd.PersistentFlags().BoolP("verbose", "v", false, "print verbose logs ($FUNC_VERBOSE)")
|
||||||
|
err := viper.BindPFlag("verbose", cmd.PersistentFlags().Lookup("verbose"))
|
||||||
|
if err != nil {
|
||||||
|
return cmd, err
|
||||||
|
}
|
||||||
|
|
||||||
// Version
|
// Version
|
||||||
// Gather the statically-set version values (populated durin build) into
|
// Gather the statically-set version values (populated durin build) into
|
||||||
|
|
Loading…
Reference in New Issue