Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upv2 feature: Add option to prevent default to be printed for BoolFlag #1122
Comments
|
@nmeilick , I have sloved this issue and submited RP. Solution Approach :
Modified files :
Before Changes :
After changes :
|
|
I put this same comment on the PR for the BoolFlag, but putting it here for additional context/discussion. Throwing this out there, it would be really nice if the I've got a situation where I'm using this library to create a containerized plugin for use within a CI environment, and it will get injected secrets through way of env variables, but if the user malforms their configuration, any of the set secrets will be exposed by the help menu. For now I'm just setting DefaultText to N/A so it doesn't appear, but this param would be nice to exist on all available flags. |
Checklist
What problem does this solve?
Since v2, the help output looks cluttered when bool flags are used, as these always get their default value appended with no apparent way to disable. The large majority of flags in applications are non-negatable or act as a form of command, so there's usually little benefit in showing the default.
From a current app of mine:
Solution description
An option within BoolFlag to disable printing the default would be helpful.