cmdHelp

package module
v0.0.0-...-1b15b8d Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: GPL-2.0 Imports: 10 Imported by: 8

Documentation

Index

Constants

View Source
const DHT = `{{if or .Runnable .HasSubCommands}}{{.UsageString}}{{end}}`
View Source
const DUT1 = `` /* 280-byte string literal not displayed */
View Source
const DUT2 = `` /* 375-byte string literal not displayed */
View Source
const DefaultFlagHelpTemplate = `` /* 132-byte string literal not displayed */
View Source
const DefaultHelpSummary = `
DefaultBinaryName - 
`
View Source
const DefaultHelpTemplate = `
{{with (or .Long .Short)}}{{. | trimTrailingWhitespaces}}

{{end}}{{if or .Runnable .HasSubCommands}}{{.UsageString}}{{end}}`
View Source
const DefaultUsageTemplate = `` /* 831-byte string literal not displayed */
View Source
const Group = "Help"

Variables

This section is empty.

Functions

func BuildCmd

func BuildCmd(cmd *cobra.Command) string

func PrintConfig

func PrintConfig(cmd *cobra.Command, prefix string)

func PrintExamples

func PrintExamples(cmd *cobra.Command, examples ...string) string

func PrintFlagEnv

func PrintFlagEnv(prefix string, flag string) string

Types

type Help

type Help struct {
	Error error

	Command          string
	HelpTemplate     string
	UsageTemplate    string
	FlagHelpTemplate string
	HelpSummary      string
	EnvPrefix        string
	ReadMe           string
	Examples         string

	SelfCmd *cobra.Command
	// contains filtered or unexported fields
}

func New

func New() *Help

func (*Help) AttachCommands

func (h *Help) AttachCommands(cmd *cobra.Command) *cobra.Command

func (*Help) CmdHelp

func (h *Help) CmdHelp(cmd *cobra.Command, args []string) error

func (*Help) ExtendedHelp

func (h *Help) ExtendedHelp()

func (*Help) GetCmd

func (h *Help) GetCmd() *cobra.Command

func (*Help) InitArgs

func (h *Help) InitArgs(_ *cobra.Command, _ []string) error

func (*Help) PrintConfig

func (h *Help) PrintConfig(cmd *cobra.Command)

func (*Help) SetCommand

func (h *Help) SetCommand(text string)

func (*Help) SetEnvPrefix

func (h *Help) SetEnvPrefix(text string)

func (*Help) SetExamples

func (h *Help) SetExamples(text string)

func (*Help) SetFlagHelpTemplate

func (h *Help) SetFlagHelpTemplate(text string)

func (*Help) SetHelpSummary

func (h *Help) SetHelpSummary(text string)

func (*Help) SetHelpTemplate

func (h *Help) SetHelpTemplate(text string)

func (*Help) SetReadMe

func (h *Help) SetReadMe(text string)

func (*Help) SetUsageTemplate

func (h *Help) SetUsageTemplate(text string)

Jump to

Keyboard shortcuts

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