-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
while print flag , the placeholder if need but not set. #2043
base: main
Are you sure you want to change the base?
Conversation
@Skeeve Thank you, could you please take a look |
I can, but I cannot approve. |
It's currently possible to get the following help output with the
I think either one of those cases could be changed to overwrite the placeholder without setting a usage. |
This whole section is questionable. Lines 300 to 310 in 7fc43e7
The |
I didn't know this was a workaround to get stdlib flag functionality. Might I add two points to consider:
|
Thanks all @avorima @abitrolly @Skeeve . I will make a summary based on your suggestions and explain my ideas ,
my next step will be:
|
Sorry , but I didn't understand this tips , because my English is not very good. |
e922a04
to
166beb6
Compare
print flag type first. Signed-off-by: jokemanfire <[email protected]>
0cb6639#diff-f09230a06a76ff761bbdcc9b788aa057cc5caa463f1bd68e67b14422938622d4R110 I think the "[]" is of no additional value and should be omitted.
I think you should avoid the "[]" marker. |
What type of PR is this?
What this PR does / why we need it:
Change like this:
OPTIONS:
--bar value
--help, -h show help
OPTIONS:
--bar string
--help, -h show help
Special notes for your reviewer:
This is a feature that I like because having a placeholder as a value is not very helpful for users. And it's a bit troublesome to specifically set up a placeholder.
Testing
I have run the help_test.go , but it can't pass . Because I consider if we should add a switch, otherwise it will affect the compatibility of the previous version
Release Notes
Change flag show placeholder to show flag initial type.