cli-docs-tool – github.com/docker/cli-docs-tool Index | Files

package clidocstool

import "github.com/docker/cli-docs-tool"

Index

Functions

func DisableFlagsInUseLine

func DisableFlagsInUseLine(cmd *cobra.Command)

DisableFlagsInUseLine sets the DisableFlagsInUseLine flag on all commands within the tree rooted at cmd.

func GenMarkdownTree

func GenMarkdownTree(cmd *cobra.Command, dir string) error

GenMarkdownTree will generate a markdown page for this command and all descendants in the directory given.

func GenTree

func GenTree(cmd *cobra.Command, dir string) error

GenTree creates yaml and markdown structured ref files for this command and all descendants in the directory given. This function will just call GenMarkdownTree and GenYamlTree functions successively.

func GenYamlCustom

func GenYamlCustom(cmd *cobra.Command, w io.Writer) error

GenYamlCustom creates custom yaml output. nolint: gocyclo

func GenYamlTree

func GenYamlTree(cmd *cobra.Command, dir string) error

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 GenYamlTreeCustom

func GenYamlTreeCustom(cmd *cobra.Command, dir string, filePrepender func(string) string) error

GenYamlTreeCustom creates yaml structured ref files.

func VisitAll

func VisitAll(root *cobra.Command, fn func(*cobra.Command))

VisitAll will traverse all commands from the root. This is different from the VisitAll of cobra.Command where only parents are checked.

Source Files

clidocstool.go clidocstool_md.go clidocstool_yaml.go markdown.go

Version
v0.1.1
Published
Sep 3, 2021
Platform
darwin/amd64
Imports
16 packages
Last checked
now

Tools for package owners.