Documentation
¶
Overview ¶
Package cobra2snooty was mostly inspired by https://github.com/spf13/cobra/tree/master/doc but with some changes to match the expected formats and styles of our writers and tools.
Index ¶
- Variables
- func DefaultExampleFormatter(w io.Writer, cmd *cobra.Command)
- func DefaultTimeGetter() time.Time
- func FlagUsages(f *pflag.FlagSet) string
- func GenDocs(cmd *cobra.Command, w io.Writer, genDocOptions ...GenDocsOption) error
- func GenTreeDocs(cmd *cobra.Command, dir string, genDocOptions ...GenDocsOption) error
- func WithCustomExampleFormatter(customFormatter ExampleFormatter) func(options *GenDocsOptions)
- func WithCustomTimeGetter(customTimeGetter func() time.Time) func(options *GenDocsOptions)
- type ExampleFormatter
- type GenDocsOption
- type GenDocsOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrMissingDescription = errors.New("missing description")
)
Functions ¶
func DefaultExampleFormatter ¶ added in v0.19.0
func DefaultTimeGetter ¶ added in v0.19.0
func FlagUsages ¶
func GenDocs ¶ added in v0.2.0
GenDocs creates snooty help output. Adapted from https://github.com/spf13/cobra/tree/master/doc to match MongoDB tooling and style.
func GenTreeDocs ¶ added in v0.2.0
func GenTreeDocs(cmd *cobra.Command, dir string, genDocOptions ...GenDocsOption) error
GenTreeDocs generates the docs for the full tree of commands.
func WithCustomExampleFormatter ¶ added in v0.19.0
func WithCustomExampleFormatter(customFormatter ExampleFormatter) func(options *GenDocsOptions)
func WithCustomTimeGetter ¶ added in v0.19.0
func WithCustomTimeGetter(customTimeGetter func() time.Time) func(options *GenDocsOptions)
Types ¶
type ExampleFormatter ¶ added in v0.19.0
type GenDocsOption ¶ added in v0.19.0
type GenDocsOption = func(options *GenDocsOptions)
type GenDocsOptions ¶ added in v0.19.0
type GenDocsOptions struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.