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:
Jake Champlin
2016-08-28 03:14:39 -04:00
parent a095a5a896
commit e0556cf9e8
4 changed files with 60 additions and 36 deletions

View File

@@ -145,6 +145,7 @@ def _write_cli_flag_types(outfile, types):
EnvVars []string
Hidden bool
Value {type}
DefaultText string
""".format(**typedef))
if typedef['dest']: