collateral

package
v0.0.0-...-4638b96 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 7, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CobraCommand

func CobraCommand(root *cobra.Command, hdr *doc.GenManHeader) *cobra.Command

CobraCommand returns a Cobra command used to output a tool's collateral files (markdown docs, bash completion & man pages) The root argument must be the root command for the tool.

func EmitCollateral

func EmitCollateral(root *cobra.Command, c *Control) error

EmitCollateral produces a set of collateral files for a CLI command. You can select to emit markdown to describe a command's function, man pages, YAML descriptions, and bash completion files.

Types

type Control

type Control struct {
	// OutputDir specifies the directory to output the collateral files
	OutputDir string

	// EmitManPages controls whether to produce man pages.
	EmitManPages bool

	// EmitYAML controls whether to produce YAML files.
	EmitYAML bool

	// EmitBashCompletion controls whether to produce bash completion files.
	EmitBashCompletion bool

	// EmitMarkdown controls whether to produce markdown documentation files.
	EmitMarkdown bool

	// EmitHTMLFragmentWithFrontMatter controls whether to produce HTML fragments with Jekyll/Hugo front matter.
	EmitHTMLFragmentWithFrontMatter bool

	// ManPageInfo provides extra information necessary when emitting man pages.
	ManPageInfo doc.GenManHeader
}

Control determines the behavior of the EmitCollateral function

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL