AddDiffOptions adds flags for the various consolidated options to the functions in the diff package
(f *pflag.FlagSet, o *diff.Options)
| 8 | |
| 9 | // AddDiffOptions adds flags for the various consolidated options to the functions in the diff package |
| 10 | func AddDiffOptions(f *pflag.FlagSet, o *diff.Options) { |
| 11 | f.BoolP("suppress-secrets", "q", false, "suppress secrets in the output") |
| 12 | f.BoolVar(&o.ShowSecrets, "show-secrets", false, "do not redact secret values in the output") |
| 13 | f.BoolVar(&o.ShowSecretsDecoded, "show-secrets-decoded", false, "decode secret values in the output") |
| 14 | f.StringArrayVar(&o.SuppressedKinds, "suppress", []string{}, "allows suppression of the kinds listed in the diff output (can specify multiple, like '--suppress Deployment --suppress Service')") |
| 15 | f.IntVarP(&o.OutputContext, "context", "C", -1, "output NUM lines of context around changes") |
| 16 | f.StringVar(&o.OutputFormat, "output", "diff", "Possible values: diff, simple, template, json, structured, dyff. When set to \"template\", use the env var HELM_DIFF_TPL to specify the template.") |
| 17 | f.BoolVar(&o.StripTrailingCR, "strip-trailing-cr", false, "strip trailing carriage return on input") |
| 18 | f.Float32VarP(&o.FindRenames, "find-renames", "D", 0, "Enable rename detection if set to any value greater than 0. If specified, the value denotes the maximum fraction of changed content as lines added + removed compared to total lines in a diff for considering it a rename. Only objects of the same Kind are attempted to be matched") |
| 19 | f.StringArrayVar(&o.SuppressedOutputLineRegex, "suppress-output-line-regex", []string{}, "a regex to suppress diff output lines that match") |
| 20 | } |
| 21 | |
| 22 | // ProcessDiffOptions processes the set flags and handles possible interactions between them |
| 23 | func ProcessDiffOptions(f *pflag.FlagSet, o *diff.Options) { |
no outgoing calls
no test coverage detected