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
cmd.SetHelpFunc(func(c*cobra.Command, s []string) {
47
47
hideInheritedFlags(c)
48
-
c.Parent().HelpFunc()(c, s)
48
+
c.Root().HelpFunc()(c, s)
49
49
})
50
50
51
51
cmd.Flags().StringArray(configFlagName, []string{}, "Locations to the config file(s), note that only a"+
52
52
" single location can be set per flag entry e.g. `--config=file:/path/to/first --config=file:path/to/second`.")
53
53
54
54
cmd.Flags().StringArray(setFlagName, []string{}, "Set arbitrary component config property. The component has to be defined in the config file and the flag"+
55
55
" has a higher precedence. Array config properties are overridden and maps are joined. Example --set=processors.batch.timeout=2s")
Short: "Validates the OpenTelemetry collector configuration without running the collector",
20
+
SilenceUsage: true, // do not display usage on error
21
+
SilenceErrors: true,
22
+
RunE: func(cmd*cobra.Command, _ []string) error {
23
+
cfgFiles, err:=getConfigFiles(cmd, false)
24
+
iferr!=nil {
25
+
returnerr
26
+
}
27
+
returnvalidateOtelConfig(cmd.Context(), cfgFiles)
28
+
},
29
+
}
30
+
31
+
cmd.Flags().StringArray(configFlagName, []string{}, "Locations to the config file(s), note that only a"+
32
+
" single location can be set per flag entry e.g. `--config=file:/path/to/first --config=file:path/to/second`.")
33
+
34
+
cmd.Flags().StringArray(setFlagName, []string{}, "Set arbitrary component config property. The component has to be defined in the config file and the flag"+
35
+
" has a higher precedence. Array config properties are overridden and maps are joined. Example --set=processors.batch.timeout=2s")
36
+
37
+
cmd.SetHelpFunc(func(c*cobra.Command, s []string) {
0 commit comments