urfave-cli/flag-gen/source/flag-types.json
Sascha Grunert 40d4a25a01
Add markdown and man page docs generation methods
This adds two new methods to the `App` struct:

- `ToMarkdown`: creates a markdown documentation string
- `ToMan`: creates a man page string

Signed-off-by: Sascha Grunert <mail@saschagrunert.de>
2019-08-07 14:02:28 +02:00

127 lines
3.3 KiB
JSON

[
{
"name": "Bool",
"type": "bool",
"value": false,
"dest": true,
"context_default": "false",
"parser": "strconv.ParseBool(f.Value.String())",
"valueString": "return \"\""
},
{
"name": "BoolT",
"type": "bool",
"value": false,
"dest": true,
"doctail": " that is true by default",
"context_default": "false",
"parser": "strconv.ParseBool(f.Value.String())",
"valueString": "return \"\""
},
{
"name": "Duration",
"type": "time.Duration",
"value": true,
"dest": true,
"doctail": " (see https://golang.org/pkg/time/#ParseDuration)",
"context_default": "0",
"parser": "time.ParseDuration(f.Value.String())",
"valueString": "return f.Value.String()"
},
{
"name": "Float64",
"type": "float64",
"value": true,
"dest": true,
"context_default": "0",
"parser": "strconv.ParseFloat(f.Value.String(), 64)",
"valueString": "return fmt.Sprintf(\"%f\", f.Value)"
},
{
"name": "Generic",
"type": "Generic",
"value": true,
"dest": false,
"context_default": "nil",
"context_type": "interface{}",
"valueString": "if f.Value != nil {\n\t\treturn f.Value.String()\n\t}\n\treturn \"\""
},
{
"name": "Int64",
"type": "int64",
"value": true,
"dest": true,
"context_default": "0",
"parser": "strconv.ParseInt(f.Value.String(), 0, 64)",
"valueString": "return fmt.Sprintf(\"%d\", f.Value)"
},
{
"name": "Int",
"type": "int",
"value": true,
"dest": true,
"context_default": "0",
"parser": "strconv.ParseInt(f.Value.String(), 0, 64)",
"parser_cast": "int(parsed)",
"valueString": "return fmt.Sprintf(\"%d\", f.Value)"
},
{
"name": "IntSlice",
"type": "*IntSlice",
"value": true,
"dest": false,
"context_default": "nil",
"context_type": "[]int",
"parser": "(f.Value.(*IntSlice)).Value(), error(nil)",
"valueString": "if f.Value != nil {\n\t\treturn f.Value.String()\n\t}\n\treturn \"\""
},
{
"name": "Int64Slice",
"type": "*Int64Slice",
"value": true,
"dest": false,
"context_default": "nil",
"context_type": "[]int64",
"parser": "(f.Value.(*Int64Slice)).Value(), error(nil)",
"valueString": "if f.Value != nil {\n\t\treturn f.Value.String()\n\t}\n\treturn \"\""
},
{
"name": "String",
"type": "string",
"value": true,
"dest": true,
"context_default": "\"\"",
"parser": "f.Value.String(), error(nil)",
"valueString": "return f.Value"
},
{
"name": "StringSlice",
"type": "*StringSlice",
"value": true,
"dest": false,
"context_default": "nil",
"context_type": "[]string",
"parser": "(f.Value.(*StringSlice)).Value(), error(nil)",
"valueString": "if f.Value != nil {\n\t\treturn f.Value.String()\n\t}\n\treturn \"\""
},
{
"name": "Uint64",
"type": "uint64",
"value": true,
"dest": true,
"context_default": "0",
"parser": "strconv.ParseUint(f.Value.String(), 0, 64)",
"valueString": "return fmt.Sprintf(\"%d\", f.Value)"
},
{
"name": "Uint",
"type": "uint",
"value": true,
"dest": true,
"context_default": "0",
"parser": "strconv.ParseUint(f.Value.String(), 0, 64)",
"parser_cast": "uint(parsed)",
"valueString": "return fmt.Sprintf(\"%d\", f.Value)"
}
]