improve flag descriptions to show allowed values instead of internal type names

Signed-off-by: h3nryc0ding <hr.richterhenry@gmail.com>
pull/5067/head
h3nryc0ding 2 months ago
parent 2a5948fe42
commit de7e9ff619

@ -52,7 +52,7 @@ func (a *CRDsPolicy) Set(str string) error {
} }
func (a *CRDsPolicy) Type() string { func (a *CRDsPolicy) Type() string {
return "crds" return strings.Join(supportedCRDsPolicies, "|")
} }
func (a *CRDsPolicy) Description() string { func (a *CRDsPolicy) Description() string {

@ -46,7 +46,7 @@ func (d *DecryptionProvider) Set(str string) error {
} }
func (d *DecryptionProvider) Type() string { func (d *DecryptionProvider) Type() string {
return "decryptionProvider" return strings.Join(supportedDecryptionProviders, "|")
} }
func (d *DecryptionProvider) Description() string { func (d *DecryptionProvider) Description() string {

@ -49,7 +49,7 @@ func (c *ECDSACurve) Set(str string) error {
} }
func (c *ECDSACurve) Type() string { func (c *ECDSACurve) Type() string {
return "ecdsaCurve" return strings.Join(ecdsaCurves(), "|")
} }
func (c *ECDSACurve) Description() string { func (c *ECDSACurve) Description() string {

@ -58,7 +58,11 @@ func (d *GitLabVisibility) Set(str string) error {
} }
func (d *GitLabVisibility) Type() string { func (d *GitLabVisibility) Type() string {
return "gitLabVisibility" visibilities := make([]string, 0, len(supportedGitLabVisibilities))
for visibility := range supportedGitLabVisibilities {
visibilities = append(visibilities, string(visibility))
}
return strings.Join(visibilities, "|")
} }
func (d *GitLabVisibility) Description() string { func (d *GitLabVisibility) Description() string {

@ -64,7 +64,7 @@ func (s *HelmChartSource) Set(str string) error {
} }
func (s *HelmChartSource) Type() string { func (s *HelmChartSource) Type() string {
return "helmChartSource" return strings.Join(supportedHelmChartSourceKinds, "|")
} }
func (s *HelmChartSource) Description() string { func (s *HelmChartSource) Description() string {

@ -71,7 +71,7 @@ func (s *KustomizationSource) Set(str string) error {
} }
func (s *KustomizationSource) Type() string { func (s *KustomizationSource) Type() string {
return "kustomizationSource" return strings.Join(supportedKustomizationSourceKinds, "|")
} }
func (s *KustomizationSource) Description() string { func (s *KustomizationSource) Description() string {

@ -58,7 +58,7 @@ func (s *LocalHelmChartSource) Set(str string) error {
} }
func (s *LocalHelmChartSource) Type() string { func (s *LocalHelmChartSource) Type() string {
return "helmChartSource" return strings.Join(supportedHelmChartSourceKinds, "|")
} }
func (s *LocalHelmChartSource) Description() string { func (s *LocalHelmChartSource) Description() string {

@ -46,7 +46,7 @@ func (l *LogLevel) Set(str string) error {
} }
func (l *LogLevel) Type() string { func (l *LogLevel) Type() string {
return "logLevel" return strings.Join(supportedLogLevels, "|")
} }
func (l *LogLevel) Description() string { func (l *LogLevel) Description() string {

@ -45,7 +45,7 @@ func (a *PublicKeyAlgorithm) Set(str string) error {
} }
func (a *PublicKeyAlgorithm) Type() string { func (a *PublicKeyAlgorithm) Type() string {
return "publicKeyAlgorithm" return strings.Join(supportedPublicKeyAlgorithms, "|")
} }
func (a *PublicKeyAlgorithm) Description() string { func (a *PublicKeyAlgorithm) Description() string {

@ -52,7 +52,7 @@ func (p *SourceBucketProvider) Set(str string) error {
} }
func (p *SourceBucketProvider) Type() string { func (p *SourceBucketProvider) Type() string {
return "sourceBucketProvider" return strings.Join(supportedSourceBucketProviders, "|")
} }
func (p *SourceBucketProvider) Description() string { func (p *SourceBucketProvider) Description() string {

@ -59,7 +59,7 @@ func (p *SourceOCIProvider) Set(str string) error {
} }
func (p *SourceOCIProvider) Type() string { func (p *SourceOCIProvider) Type() string {
return "sourceOCIProvider" return strings.Join(supportedSourceOCIProviders, "|")
} }
func (p *SourceOCIProvider) Description() string { func (p *SourceOCIProvider) Description() string {

@ -47,7 +47,7 @@ func (p *SourceOCIVerifyProvider) Set(str string) error {
} }
func (p *SourceOCIVerifyProvider) Type() string { func (p *SourceOCIVerifyProvider) Type() string {
return "sourceOCIVerifyProvider" return strings.Join(supportedSourceOCIVerifyProviders, "|")
} }
func (p *SourceOCIVerifyProvider) Description() string { func (p *SourceOCIVerifyProvider) Description() string {

Loading…
Cancel
Save