-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplates.go
More file actions
37 lines (31 loc) · 887 Bytes
/
Copy pathtemplates.go
File metadata and controls
37 lines (31 loc) · 887 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package command
var fullHelpTemplate = `
{{- .ArgUsage -}}
{{ if .Aliases }}
{{ .AliasesString }}
{{- end }}
{{ or .LongDescription .ShortDescription | wrap }}
{{ if and .Flags (len .Flags.FlagDefs) -}}
{{ title "Flags" }}
{{ .FlagString 2 -}}
{{- end -}}
{{- if .Examples }}
{{ title "Examples" -}}
{{ range .Examples }}
{{ printf "%s:" .Description | ansi "2" }}
{{ exec }} {{ bold "33" .Command -}}
{{- range .Args }} {{ if hasPrefix . "." -}}
{{ ansi "34" . -}} {{- else -}} {{- . }}
{{- end -}} {{- end -}}
{{- range .Flags }} {{ if hasPrefix . "-" -}}
{{- ansi "36" . -}} {{- else -}} {{- ansi "32" . -}} {{- end -}}
{{- end }}
{{ end }}
{{ end -}}
{{- if .SeeAlso -}}
{{ title "See also" }}
{{ .SeeAlsoString 2 }}
{{- end -}}`
var usageTemplate = `
{{- title "Usage" -}} {{ exec }} {{ bold "33" .Name }}
{{- range .Usage }} {{ ansi "36" . }} {{- end -}}`