docs

package
v6.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LongDescriptions added in v6.3.0

func LongDescriptions(sourcePath string) (map[string]string, error)

LongDescriptions parses a Go source file and returns a map from each urfave/cli flag's Name field to its long docs description, derived from the leading doc comment directly above the flag's composite literal.

Convention: a // comment block directly above an &cli.XFlag{...} literal is treated as the long docs description. Lines within a paragraph are joined with spaces; paragraphs (separated by an empty // line) are joined with "\n\n". A blank line in the source between the comment and the literal breaks the association.

This helper is intentionally format-agnostic: callers are responsible for merging the result into their docs format of choice (YAML, JSON, markdown, etc.).

func ToMarkdown

func ToMarkdown(app *cli.Command) (string, error)

ToMarkdown creates a markdown string for the `*App` The function errors if either parsing or writing of the string fails.

Types

type CliTemplate

type CliTemplate struct {
	Name        string
	Version     string
	Description string
	Usage       string
	UsageText   string
	GlobalArgs  []*PluginArg
}

func GetTemplateData

func GetTemplateData(app *cli.Command) *CliTemplate

type PluginArg

type PluginArg struct {
	Name        string
	EnvVars     []string
	Description string
	Default     string
	Type        string
	Required    bool
}

Jump to

Keyboard shortcuts

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