MCPcopy Create free account
hub / github.com/conforma/cli / setFlags

Function setFlags

cmd/root/root_cmd.go:198–222  ·  view source on GitHub ↗
(rootCmd *cobra.Command)

Source from the content-addressed store, hash-verified

196}
197
198func setFlags(rootCmd *cobra.Command) {
199 traceFlag := &pflag.Flag{
200 Name: "trace",
201 Usage: "enable trace logging, set one or more comma separated values: none,all," + tracing.All.String(),
202 Value: &enabledTraces,
203 DefValue: enabledTraces.String(),
204 NoOptDefVal: tracing.Default.String(),
205 }
206 rootCmd.PersistentFlags().AddFlag(traceFlag)
207
208 rootCmd.PersistentFlags().BoolVar(&quiet, "quiet", quiet, "less verbose output")
209 rootCmd.PersistentFlags().BoolVar(&verbose, "verbose", verbose, "more verbose output")
210 rootCmd.PersistentFlags().BoolVar(&debug, "debug", debug, "same as verbose but also show function names and line numbers")
211 rootCmd.PersistentFlags().DurationVar(&globalTimeout, "timeout", globalTimeout, "max overall execution duration")
212 rootCmd.PersistentFlags().StringVar(&logfile, "logfile", "", "file to write the logging output. If not specified logging output will be written to stderr")
213
214 // Retry configuration flags
215 rootCmd.PersistentFlags().DurationVar(&retryMaxWait, "retry-max-wait", retryMaxWait, "maximum wait time between retries")
216 rootCmd.PersistentFlags().IntVar(&retryMaxRetry, "retry-max-retry", retryMaxRetry, "maximum number of retry attempts")
217 rootCmd.PersistentFlags().DurationVar(&retryDuration, "retry-duration", retryDuration, "base duration for exponential backoff calculation")
218 rootCmd.PersistentFlags().Float64Var(&retryFactor, "retry-factor", retryFactor, "exponential backoff multiplier")
219 rootCmd.PersistentFlags().Float64Var(&retryJitter, "retry-jitter", retryJitter, "randomness factor for backoff calculation (0.0-1.0)")
220
221 kubernetes.AddKubeconfigFlag(rootCmd)
222}

Callers 1

NewRootCmdFunction · 0.85

Calls 2

AddKubeconfigFlagFunction · 0.92
StringMethod · 0.45

Tested by

no test coverage detected