Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AppHelpTemplate = `## NAME **{{.HelpName}}** -- {{.Usage}} ## USAGE {{if .UsageText}}{{.UsageText}}{{else}}**{{.HelpName}}**{{if .Commands}} <command>{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}_[arguments]_{{end}}{{end}}{{if .Description}} ## DESCRIPTION {{.Description}}{{end}}{{if .VisibleCommands}} ## COMMANDS {{range .VisibleCategories}}{{if .Name}}{{.Name}}:{{end}} ||| |---|---|{{range .VisibleCommands}} | **{{join .Names ", "}}** | {{.Usage}} |{{end}} {{end}}{{if .VisibleFlags}}{{end}} ## OPTIONS {{range $index, $option := .VisibleFlags}}{{if $index}} {{end}}{{$option}} {{end}}{{end}}{{if .Copyright}}{{if len .Authors}} ## AUTHOR{{with $length := len .Authors}}{{if ne 1 $length}}S{{end}}{{end}}: {{range $index, $author := .Authors}}{{if $index}} {{end}}{{$author}}{{end}}{{end}}{{if .Version}}{{if not .HideVersion}} ## ONLINE This documentation is available online at https://smallstep.com/docs/cli ## VERSION {{.Version}}{{end}}{{end}} ## COPYRIGHT {{.Copyright}} ## FEEDBACK ` + html.UnescapeString("&#"+strconv.Itoa(128525)+";") + " " + html.UnescapeString("&#"+strconv.Itoa(127867)+";") + ` The **step** utility is not instrumented for usage statistics. It does not phone home. But your feedback is extremely valuable. Any information you can provide regarding how you’re using **step** helps. Please send us a sentence or two, good or bad: **feedback@smallstep.com** or ask in [GitHub Discussions](https://github.com/smallstep/certificates/discussions). {{end}} `
AppHelpTemplate contains the modified template for the main app
var CommandHelpTemplate = `` /* 403-byte string literal not displayed */
CommandHelpTemplate contains the modified template for a command
var HelpCommandAction = cli.ActionFunc(helpAction)
HelpCommandAction is the action function of the overwritten help command.
var SubcommandHelpTemplate = `` /* 531-byte string literal not displayed */
SubcommandHelpTemplate contains the modified template for a sub command Note that the weird "|||\n|---|---|" syntax sets up a markdown table with empty headers.
Functions ¶
func FlagNamePrefixer ¶
FlagNamePrefixer converts a full flag name and its placeholder into the help message flag prefix. This is used by the default FlagStringer.
This method clones urflave/cli functionality but adds a new line at the end.
func HelpCommand ¶
HelpCommand overwrites default urfvafe/cli help command to support one or multiple subcommands like:
step help step help crypto step help crypto jwt step help crypto jwt sign ...
func HelpPrinter ¶
HelpPrinter overwrites cli.HelpPrinter and prints the formatted help to the terminal.
Types ¶
type Argument ¶
Argument specifies the Name, Usage, and whether or not an Argument is required or not
type Arguments ¶
type Arguments []Argument
Arguments is an array of Argument structs that specify which arguments are accepted by a Command
type RenderMode ¶
type RenderMode int
RenderMode enumerates different line breaks modes.
const ( // RenderModeKeepBreaks will keep the line breaks in the docs. RenderModeKeepBreaks RenderMode = iota // RenderModeBreakLines will automatically wrap the lines. RenderModeBreakLines )
type Renderer ¶
type Renderer struct {
// contains filtered or unexported fields
}
Renderer implements a custom markdown renderer for blackfriday.
func (*Renderer) RenderFooter ¶
RenderFooter implements blackfriday.Renderer interface.
func (*Renderer) RenderHeader ¶
RenderHeader implements blackfriday.Renderer interface.
func (*Renderer) RenderNode ¶
RenderNode implements blackfriday.Renderer interface.
type Report ¶ added in v0.8.1
type Report struct {
Report []*Section `json:"report"`
}
Report holds together a report of sections
func (*Report) PerHeadline ¶ added in v0.8.1
PerHeadline returns all sections across commands/pages with the same headline