pflag icon indicating copy to clipboard operation
pflag copied to clipboard

add two functions to get flag usages without (default xxx) at the end of the line

Open romberli opened this issue 5 years ago • 6 comments

added FlagUsagesWithoutDefault(), FlagUsagesWrappedWithoutDefault() function which could return flag usages without default at the end of the line

romberli avatar Dec 24 '20 03:12 romberli

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Dec 24 '20 03:12 CLAassistant

when this PR will be merged? I need to create a PR on cobra project which uses this project after this commit being merged.

romberli avatar Dec 24 '20 03:12 romberli

@romberli it's extremely unlikely that you're PR will ever get a response, let alone be merged. The maintainers only seem to care if you work on a big project or work at google. I suggest you use my fork, which works with cobra, and has already addressed the spirit of what you're looking for.

cornfeedhobo avatar Dec 24 '20 20:12 cornfeedhobo

@cornfeedhobo ,so sad to hear that, but it seems that I do not have other choice, because cobra will never use other forks.

romberli avatar Dec 28 '20 12:12 romberli

@romberli My fork has instructions on using it with cobra.

go mod edit -replace github.com/spf13/pflag=github.com/cornfeedhobo/pflag

cornfeedhobo avatar Dec 28 '20 12:12 cornfeedhobo

@romberli Could you expand a little bit on the rationale behind this feature? Why is it desirable to print usage info without the default values for flags?

tomasaschan avatar Oct 15 '25 16:10 tomasaschan