template

package
v1.16.1 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AppHelp = Primary("\nDOPS - CLI DevOps Toolkit") + `

{{if .VisibleFlags}}` + Section(`Global options`) + `
  ` + Flag(`{{range $index, $option := .VisibleFlags}}{{if $index}}`) + `
  ` + Flag(`{{end}}{{$option}}{{end}}{{end}}`) + `

{{if .VisibleCommands}}` + Section(`Modules`) + `{{range .VisibleCategories}}{{if .Name}}
  [` + Primary(`{{.Name}}`) + `]{{range .VisibleCommands}}
    · ` + Secondary(`{{join .Names ", "}}`) + Separator(`{{"\t|\t"}}`) + `{{.Usage}}{{end}}{{else}}{{range .VisibleCommands}}
    · ` + Secondary(`{{join .Names ", "}}`) + Separator(`{{"\t|\t"}}`) + `{{.Usage}}{{end}}{{end}}{{end}}{{end}}

` + HiRedString("Contribute to this tool here: https://github.com/dops-cli ") + RedString("<3\n")

AppHelp contains the template of dops help text.

View Source
var CommandHelp = Primary("\n{{.Name}}") + ` - ` + Secondary("{{.Usage}}") + `

` + Primary("Usage:") + ` {{if .UsageText}}{{.UsageText}}{{else}}{{.HelpName}}{{if .VisibleFlags}} [options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}}{{end}}
{{if .Aliases}}` + Primary("Aliases:") + `  {{join .Aliases ", "}}{{end}}
{{if .Category}}` + Primary("Category:") + ` {{.Category}}{{end}}{{if .Description}}

` + Section("Description") + `
{{.Description}}{{end}}{{if .VisibleFlags}}

` + Section("Options") + `
   {{range .VisibleFlags}}` + Flag("{{.}}") + `
   {{end}}{{end}}
`

CommandHelp contains the template of dops modules help text.

View Source
var MarkdownDoc = `% {{ .App.Name }} 8

# NAME

{{ .App.Name }}{{ if .App.Usage }} - {{ .App.Usage }}{{ end }}

# SYNOPSIS

{{ .App.Name }}
{{ if .SynopsisArgs }}
` + "```" + `
{{ range $v := .SynopsisArgs }}{{ $v }}{{ end }}` + "```" + `
{{ end }}{{ if .App.UsageText }}
# DESCRIPTION

{{ .App.UsageText }}
{{ end }}
**Usage**:

` + "```" + `
{{ .App.Name }} [GLOBAL OPTIONS] command [COMMAND OPTIONS] [ARGUMENTS...]
` + "```" + `
{{ if .GlobalArgs }}
# GLOBAL OPTIONS
{{ range $v := .GlobalArgs }}
{{ $v }}{{ end }}
{{ end }}{{ if .Commands }}
# COMMANDS
{{ range $v := .Commands }}
{{ $v }}{{ end }}{{ end }}`

MarkdownDoc contains the template for generating a module list in markdown

View Source
var SubcommandHelp = `` /* 600-byte string literal not displayed */

SubcommandHelp is the text template for the subcommand help topic. cli.go uses text/template to render templates. You can render custom help text by setting this variable.

Functions

func PrintModules added in v1.6.0

func PrintModules() error

PrintModules prints all modules to stdout

func PrintModulesMarkdown added in v1.7.0

func PrintModulesMarkdown() error

PrintModulesMarkdown prints all modules in markdown format to stdout

Types

type Modules added in v1.6.0

type Modules struct {
	Commands cli.Commands
}

Modules is a wrapper for cli.Commands

Jump to

Keyboard shortcuts

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