Charmil Example Builder
Example Builder#
Example Builder provides Example string builder which generates full example string of the cobra command and append to existing examples.
NewCmdExample function accepts a cobra command in which example needs to be generated, description of the command and a slice of flags(if any)
examplebuilder.NewCmdExample(cmd, "List all artifacts for the default artifacts group", []string{"list --page=4"})examplebuilder.NewCmdExample(cmd, "List all artifacts", []string{"list"})Output
Examples:
# List all artifacts for the default artifacts groupkafka list --page=4
# List all artifactskafka list