Documentation
¶
Index ¶
- Variables
- func ToJSON(cmd *cli.Command) ([]byte, error)
- func ToMan(cmd *cli.Command) (string, error)
- func ToManWithSection(cmd *cli.Command, sectionNumber int) (string, error)
- func ToMarkdown(cmd *cli.Command) (string, error)
- func ToTabularMarkdown(cmd *cli.Command, appPath string) (string, error)
- func ToTabularToFileBetweenTags(cmd *cli.Command, appPath, filePath string, startEndTags ...string) error
- type CLICommand
- type CLIFlag
Constants ¶
This section is empty.
Variables ¶
var ( //go:embed markdown.md.gotmpl MarkdownDocTemplate string //go:embed markdown_tabular.md.gotmpl MarkdownTabularDocTemplate string )
Functions ¶
func ToMan ¶
ToMan creates a man page string for the `*cli.Command` The function errors if either parsing or writing of the string fails.
func ToManWithSection ¶
ToMan creates a man page string with section number for the `*cli.Command` The function errors if either parsing or writing of the string fails.
func ToMarkdown ¶
ToMarkdown creates a markdown string for the `*cli.Command` The function errors if either parsing or writing of the string fails.
func ToTabularMarkdown ¶
ToTabularMarkdown creates a tabular markdown documentation for the `*cli.Command`. The function errors if either parsing or writing of the string fails.
func ToTabularToFileBetweenTags ¶
func ToTabularToFileBetweenTags(cmd *cli.Command, appPath, filePath string, startEndTags ...string) error
ToTabularToFileBetweenTags creates a tabular markdown documentation for the `*App` and updates the file between the tags in the file. The function errors if either parsing or writing of the string fails.
Types ¶
type CLICommand ¶
type CLICommand struct {
Name string `json:"name"`
Aliases []string `json:"aliases,omitempty"`
Usage string `json:"usage,omitempty"`
UsageText []string `json:"usageText,omitempty"`
Description string `json:"description,omitempty"`
ArgsUsage string `json:"argsUsage,omitempty"`
Category string `json:"category,omitempty"`
Version string `json:"version,omitempty"`
Hidden bool `json:"hidden,omitempty"`
Flags []CLIFlag `json:"flags,omitempty"`
Commands []CLICommand `json:"commands,omitempty"`
}
type CLIFlag ¶
type CLIFlag struct {
Name string `json:"name"`
Aliases []string `json:"aliases,omitempty"`
Usage string `json:"usage,omitempty"`
Type string `json:"type,omitempty"`
Default string `json:"default,omitempty"`
TakesValue bool `json:"takesValue"`
EnvVars []string `json:"envVars,omitempty"`
Hidden bool `json:"hidden,omitempty"`
Required bool `json:"required,omitempty"`
}