Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change flags with fixed allowed values to show the actual values #5066

Open
darkowlzz opened this issue Nov 8, 2024 · 0 comments · May be fixed by #5067
Open

Change flags with fixed allowed values to show the actual values #5066

darkowlzz opened this issue Nov 8, 2024 · 0 comments · May be fixed by #5067
Labels
area/ux In pursuit of a delightful user experience good first issue Good for newcomers

Comments

@darkowlzz
Copy link
Contributor

darkowlzz commented Nov 8, 2024

Currently, a lot of the flags that accept various fixed values show arbitrary type name instead of the actual values they accept. For example, in flux create source oci -h

--ignore-paths strings                      set paths to ignore resources (can specify multiple paths with commas: path1,path2)
--insecure                                  for when connecting to a non-TLS registries over plain HTTP
--provider sourceOCIProvider                the OCI provider name, available options are: (generic, aws, azure, gcp) (default generic)
--proxy-secret-ref string                   the name of an existing secret containing the proxy address and credentials

--provider accepts a fixed set of values. But unlike the other flags that show the known type of what's accepted, it shows sourceOCIProvider. This type is not known to the user, unlike int or string. It would be much better to list all the values. This would also shorten the flag description.

This has already been implemented in flux create source git for --provider flag

--private-key-file string                path to a passwordless private key file used for authenticating to the Git SSH server
--provider generic|azure                 the Git provider name
--proxy-secret-ref string                the name of an existing secret containing the proxy address and credentials

Refer https://github.com/fluxcd/flux2/blob/v2.4.0/internal/flags/source_git_provider.go#L51-L53 for the implementation.

The pflag Values.Type() implementation should append the allowed values and return it, instead of returning an internal data type name that's not known to the user.

All such flags in the CLI subcommands should be changed accordingly.

This was discussed and agreed upon in a Flux dev meeting.

@darkowlzz darkowlzz added good first issue Good for newcomers area/ux In pursuit of a delightful user experience labels Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ux In pursuit of a delightful user experience good first issue Good for newcomers
Projects
None yet
1 participant