Documentation
¶
Index ¶
- func CobraCommand(root *cobra.Command, hdr *doc.GenManHeader) *cobra.Command
- func CobraCommandWithFilter(root *cobra.Command, hdr *doc.GenManHeader, p Predicates) *cobra.Command
- func DefaultSelectEnvFn(_ env.Var) bool
- func DefaultSelectMetricFn(_ metrics.Exported) bool
- func EmitCollateral(root *cobra.Command, c *Control) error
- type Control
- type Predicates
- type SelectEnvFn
- type SelectMetricFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CobraCommand ¶
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 CobraCommandWithFilter ¶
func CobraCommandWithFilter(root *cobra.Command, hdr *doc.GenManHeader, p Predicates) *cobra.Command
CobraCommandWithFilter returns a Cobra command used to output a tool's collateral files (markdown docs, bash completion & man pages). It allows passing in a set of predicates to filter out and remove items selectively. The root argument must be the root command for the tool.
func DefaultSelectEnvFn ¶
DefaultSelectEnvFn is used to select all environment variables.
func DefaultSelectMetricFn ¶
DefaultSelectMetricFn is used to seelct all metrics.
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
// EmitZshCompletion controls whether to produce zsh completion files.
EmitZshCompletion 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
// Predicates to use to filter environment variables and metrics. If not set, all items will be selected.
Predicates Predicates
}
Control determines the behavior of the EmitCollateral function
type Predicates ¶
type Predicates struct {
SelectEnv SelectEnvFn
SelectMetric SelectMetricFn
}
Predicates are a set of predicates to apply when generating collaterals.
type SelectEnvFn ¶
SelectEnvFn is a predicate function for selecting environment variables when generating collateral documents.
type SelectMetricFn ¶
SelectMetricFn is a predicate function for selecting metrics when generating collateral documents.