type cmdOption … type cmdDoc … // GenYamlTree creates yaml structured ref files for this command and all descendants // in the directory given. This function may not work // correctly if your command names have `-` in them. If you have `cmd` with two // subcmds, `sub` and `sub-third`, and `sub` has a subcommand called `third` // it is undefined which help output will be in the file `cmd-sub-third.1`. func GenYamlTree(cmd *cobra.Command, dir string) error { … } // GenYamlTreeCustom creates yaml structured ref files. func GenYamlTreeCustom(cmd *cobra.Command, dir string, filePrepender, linkHandler func(string) string) error { … } // GenYaml creates yaml output. func GenYaml(cmd *cobra.Command, w io.Writer) error { … } // GenYamlCustom creates custom yaml output. func GenYamlCustom(cmd *cobra.Command, w io.Writer, linkHandler func(string) string) error { … } func genFlagResult(flags *pflag.FlagSet) []cmdOption { … }