Fix panic when no args supplied to cli-doc
Fixes:
@@ -143,6 +143,9 @@ func main() {
ValidArgs: []string{"help", "reference", "structure"},
Run: func(command *cobra.Command, args []string) {
+ if len(args) == 0 {
+ fmt.Print(command.Usage())
+ } else {
switch args[0] {
case "reference":
fmt.Print(referencePrinter(cli.RootCmd(), 0))
@@ -151,6 +154,7 @@ func main() {
default:
fmt.Print(command.Usage())
}
+ }
},
}
