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

Required flags still show (default: ...) value #1544

Open
travisdowns opened this issue Nov 28, 2021 · 2 comments
Open

Required flags still show (default: ...) value #1544

travisdowns opened this issue Nov 28, 2021 · 2 comments
Labels
area/flags-args Changes to functionality around command line flags and args kind/feature A feature request for cobra; new or enhanced behavior lifecycle/needs-pr Ready for a PR from the community

Comments

@travisdowns
Copy link

If you mark a flag as required using MarkFlagRequired then it doesn't have a default value, per se: it will always be present on the command line.

However, the help message still shows (default: ...) for that flag.

Is there any way to remove that part of the help message?

@github-actions
Copy link

This issue is being marked as stale due to a long period of inactivity

@johnSchnake
Copy link
Collaborator

That seems like a reasonable point. I guess someone may want to suggest a reasonable value but still require it to be specified. In that case though that could go in the description of the flag. 👍

@johnSchnake johnSchnake added area/flags-args Changes to functionality around command line flags and args kind/feature A feature request for cobra; new or enhanced behavior needs PR and removed kind/stale labels Feb 23, 2022
@jpmcb jpmcb removed the needs PR label Feb 23, 2022
@johnSchnake johnSchnake added the lifecycle/needs-pr Ready for a PR from the community label Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/flags-args Changes to functionality around command line flags and args kind/feature A feature request for cobra; new or enhanced behavior lifecycle/needs-pr Ready for a PR from the community
Projects
None yet
Development

No branches or pull requests

3 participants