template

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2020 License: MIT Imports: 1 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{{.HelpName}}") + ` - ` + 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 MarkdownDocTemplate = `% {{ .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 }}`
View Source
var SubcommandHelpTemplate = `` /* 600-byte string literal not displayed */

SubcommandHelpTemplate 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

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