-
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
If the Version string is empty, the version section should not appear in usage output #248
Comments
Closed via #251; thank you! |
How come when I use this package it still shows the version? |
Are you seeing the VERSION: info in the help output or elsewhere? |
Yes, in the help output. On second look, I am assuming that PR only affects it not in the help output? |
After getting the pointer from NewApp (e.g., "app"), did you define app.Version as ""? |
In addition, if you don't want the option named "version" working nor displayed in the help, you should also set app.HideVersion = true (as noted in the PR above). Then -v will throw an error and -h will not show a version number nor a version global option. |
If the Version string is empty, then the version section should not be displayed at all in the usage output. Currently if the version string is empty, the usage output prints "VERSION:" followed by an empty line.
It would be up to the user to set HideVersion=true to remove the now-superfluous option when they define Version=""
(I was originally going to suggest that the default be an empty string as well, but that could have unwanted side-effects on downstream projects. Instead, one would simply empty the Version string to cause it to be hidden from the usage output, which should not have side-effects).
The text was updated successfully, but these errors were encountered: