gendocs: remove global flags from command help pages

This commit is contained in:
Nick Craig-Wood
2019-05-11 23:39:50 +01:00
parent dbf9800cbc
commit f544234e26
66 changed files with 361 additions and 20039 deletions
+5
View File
@@ -11,6 +11,7 @@ import (
"github.com/ncw/rclone/cmd"
"github.com/spf13/cobra"
"github.com/spf13/cobra/doc"
"github.com/spf13/pflag"
)
func init() {
@@ -50,6 +51,10 @@ rclone.org website.`,
base := strings.TrimSuffix(name, path.Ext(name))
return "/commands/" + strings.ToLower(base) + "/"
}
// Hide all of the root entries flags
cmd.Root.Flags().VisitAll(func(flag *pflag.Flag) {
flag.Hidden = true
})
return doc.GenMarkdownTreeCustom(cmd.Root, out, prepender, linkHandler)
},
}