format

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OnlyUsageString = "{{if or .Runnable .HasSubCommands}}{{.UsageString}}{{end}}"
	ADocHelpTable   = `{{if .HasAvailableLocalFlags}}{{ $tick := "` + "`" + `" }}
[cols="2,4,2,1"]
|===
|Option|Purpose|Format|Default
{{range localFlagsSlice .LocalFlags}}{{ if not .Hidden }}
|{{$tick}}--{{.Name}}{{$tick}} {{if .Shorthand}}({{$tick}}-{{.Shorthand}}{{$tick}}){{end}}
|{{.Usage}}
|{{type .}}
|{{if .DefValue}}{{$tick}}{{.DefValue | trimTrailingWhitespaces}}{{$tick}}{{end}}{{end}}
{{end}}
|===
{{end}}`
)

Variables

This section is empty.

Functions

func EnhanceHelper

func EnhanceHelper(command *cobra.Command)

EnhanceHelper wraps helper function with alternative formatting and templates (e.g. asciidoc) based on --helper-format flag Applies to all sub commands. This can be useful when automatically generating documentation for CLI

func RegisterTemplateFuncs

func RegisterTemplateFuncs()

Types

This section is empty.

Jump to

Keyboard shortcuts

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