Skip to content

Commit b37410d

Browse files
committed
Update docs.go
1 parent 8df6286 commit b37410d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

serve/docs.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package serve
22

33
import (
4+
"errors"
45
"fmt"
56
"strings"
67

@@ -43,11 +44,11 @@ func (s *PluginServe) newCmdPluginDoc() *cobra.Command {
4344
return err
4445
}
4546
g := docs.NewGenerator(s.plugin.Name(), tables)
46-
f := docs.FormatMarkdown
47-
if format.Value == "json" {
48-
f = docs.FormatJSON
47+
if format.Value != "json" {
48+
return errors.New("only json format is supported. If need to generate markdown, use the `cloudquery tables` command")
4949
}
50-
return g.Generate(args[0], f)
50+
51+
return g.GenerateJSON(args[0], docs.FormatJSON)
5152
},
5253
}
5354
cmd.Flags().Var(format, "format", fmt.Sprintf("output format. one of: %s", strings.Join(format.Allowed, ",")))

0 commit comments

Comments
 (0)