templates

package
v0.0.0-...-46800f1 Latest Latest
Warning

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

Go to latest
Published: May 11, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SectionAliases = `{{if gt (len .Aliases) 0}}Aliases:
{{.NameAndAliases}}

{{end}}`

	SectionExamples = `{{if .HasExample}}Examples:
{{trimRight .Example}}

{{end}}`

	SectionSubcommands = `{{if .HasAvailableSubCommands}}{{cmdGroupsString .}}

{{end}}`

	SectionFlags = `{{if .HasLocalFlags}}Options:
{{flagsUsages .LocalFlags}}
{{end}}`
)
View Source
const Indentation = `  `

Variables

This section is empty.

Functions

func ActsAsRootCommand

func ActsAsRootCommand(cmd *cobra.Command, groups ...CommandGroup)

func Examples

func Examples(s string) string

Examples normalizes a command's examples to follow the conventions.

func HelpTemplate

func HelpTemplate() string

template for help command

func LongDesc

func LongDesc(s string) string

func UsageTemplate

func UsageTemplate() string

command usage template

Types

type CommandGroup

type CommandGroup struct {
	Message  string
	Commands []*cobra.Command
}

type CommandGroups

type CommandGroups []CommandGroup

func (CommandGroups) AddTo

func (g CommandGroups) AddTo(c *cobra.Command)

Jump to

Keyboard shortcuts

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