help

package
v0.0.0-...-5d27ecb Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const BasicHelpTemplate = `` /* 451-byte string literal not displayed */

BasicHelpTemplate is the current view template of the help output.

View Source
const CommandHelpTemplate = `` /* 858-byte string literal not displayed */

CommandHelpTemplate represents a template for rendering the help for commands and subcommands.

View Source
const HelpTemplateFormat = `    {{green .Name}}	{{.Synopsis}}`

HelpTemplateFormat defines a basic format for templating a help template.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command interface {
	Synopsis() string
}

Command represents an abstraction of command.

type Func

type Func func(...HelpOption) (string, error)

Func is the type of the function that is responsible for generating the help output when the CLI must show the general help text.

func BasicFunc

func BasicFunc(name string) Func

BasicFunc generates some bashic help output that is usually good enough for most CLI applications.

type HelpOption

type HelpOption func(HelpOptions)

HelpOption captures a tweak that can be applied to the Help.

func OptionColor

func OptionColor(i bool) HelpOption

OptionColor allows the setting a color option to configure the group.

func OptionCommands

func OptionCommands(i map[string]Command) HelpOption

OptionCommands allows the setting a commands option to configure the group.

func OptionErr

func OptionErr(i string) HelpOption

OptionErr allows the setting a hint option to configure the group.

func OptionFlags

func OptionFlags(i []string) HelpOption

OptionFlags allows the setting a commands option to configure the group.

func OptionFormat

func OptionFormat(i string) HelpOption

OptionFormat allows the setting a format option to configure the group.

func OptionHeader

func OptionHeader(i string) HelpOption

OptionHeader allows the setting a header option to configure the group.

func OptionHelp

func OptionHelp(i string) HelpOption

OptionHelp allows the setting a hint option to configure the group.

func OptionHint

func OptionHint(i string) HelpOption

OptionHint allows the setting a hint option to configure the group.

func OptionShowHelp

func OptionShowHelp(i bool) HelpOption

OptionShowHelp allows the setting a color option to configure the group.

func OptionTemplate

func OptionTemplate(i string) HelpOption

OptionTemplate allows the setting a template option to configure the group.

func OptionUsages

func OptionUsages(i []string) HelpOption

OptionUsages allows the setting a commands option to configure the group.

type HelpOptions

type HelpOptions interface {
	SetHeader(string)
	SetHint(string)
	SetHelp(string)
	SetErr(string)
	SetCommands(map[string]Command)
	SetFlags([]string)
	SetUsages([]string)
	SetFormat(string)
	SetColor(bool)
	SetTemplate(string)
	SetShowHelp(bool)
}

HelpOptions represents a way to set optional values to a autocomplete option. The HelpOptions shows what options are available to change.

Jump to

Keyboard shortcuts

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