template

package
v1.33.3 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package template provides usage templates to render help menus.

Index

Constants

View Source
const Usage = `` /* 561-byte string literal not displayed */

Usage is the text template for a single command.

Variables

View Source
var RootUsage = fmt.Sprintf("{{h1 \"Commands\"}}{{ $cmds := .Commands }}{{$groups := mkSlice \"%s\" \"%s\" \"%s\" \"%s\" \"%s\" }}{{range $group := $groups }} \n",
	group.GettingStarted, group.Develop, group.Release, group.Extend, group.Settings) +
	`  {{h2 $group}}{{$groupCmds := (filterCmdsByGroup $cmds $group)}}
{{- range $j, $cmd := $groupCmds}}{{$lines := split $cmd.Short "\n"}}
{{- range $i, $line := $lines}}
    {{if eq $i 0}}{{rpad $cmd.Name $cmd.NamePadding}} {{$line}}
    {{- else}}{{rpad "" $cmd.NamePadding}} {{$line}}
{{- end}}{{end}}{{if and (gt (len $lines) 1) (ne (inc $j) (len $groupCmds))}}
{{- end}}{{end}}
{{end}}{{if .HasAvailableLocalFlags}}
{{h1 "Flags"}}
{{.LocalFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasAvailableInheritedFlags}}

{{h1 "Global Flags"}}
{{.InheritedFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasExample}}

{{h1 "Examples"}}{{code .Example}}{{end}}
`

RootUsage is the text template for the root command.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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