diff --git a/docs/docs.go b/docs/docs.go index 6c4f41f..c1a1385 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -115,18 +115,24 @@ func parseFlags(flags []cli.Flag) []*PluginArg { func parseType(raw string) string { reSlice := regexp.MustCompile(`^\*cli\.(.+?)SliceFlag$`) - if reSlice.MatchString(raw) { return "list" } + reMap := regexp.MustCompile(`^\*cli\.(.+?)MapFlag$`) + if reMap.MatchString(raw) { + return "dict" + } + re := regexp.MustCompile(`^\*cli\.(.+?)Flag$`) match := re.FindStringSubmatch(raw) if len(match) > 1 { switch ctype := strings.ToLower(match[1]); ctype { - case "int", "int64", "uint", "uint64", "float64": - return "number" + case "int", "int64", "uint", "uint64": + return "integer" + case "float64": + return "float" default: return ctype } diff --git a/docs/docs_test.go b/docs/docs_test.go index 0bbb505..a874556 100644 --- a/docs/docs_test.go +++ b/docs/docs_test.go @@ -113,7 +113,7 @@ func TestToData(t *testing.T) { Name: "dummy_flag_int", Description: "dummy int flag desc", Default: "10", - Type: "number", + Type: "integer", Required: true, }, {