Add DefaultValue text for flags
Allows a user to override the default value of a flag in the displayed help output.
Ex:
```
cli.IntFlag{
Name: "foo, f",
DefaultText: "random foo",
Value: "bar",
}
```
Running `(app.name) -h` will now yield:
```
--foo value (default: "random foo")
```
Fixes: #504
This commit is contained in:
@@ -145,6 +145,7 @@ def _write_cli_flag_types(outfile, types):
|
||||
EnvVars []string
|
||||
Hidden bool
|
||||
Value {type}
|
||||
DefaultText string
|
||||
""".format(**typedef))
|
||||
|
||||
if typedef['dest']:
|
||||
|
||||
Reference in New Issue
Block a user