Silence usage on commands that apply
This commit is contained in:
1 parent
6436253629
commit
da81e6ccd9
3 files changed
+11
-2
No files matched your search
@@ -48,6 +48,10 @@ func commandInit() *cobra.Command {
|
||||
return err
|
||||
}
|
||||
|
||||
// Flags and arguments are valid from here on, so errors are runtime
|
||||
// failures: report them without cobra's usage text.
|
||||
cmd.SilenceUsage = true
|
||||
|
||||
cfgFile, _ := cmd.Flags().GetString("config")
|
||||
if cfgFile != "" {
|
||||
// Use config file from the flag.
|
||||
|
||||
Reference in new issue
Block a user