-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathhelp.tmpl
More file actions
50 lines (39 loc) · 939 Bytes
/
help.tmpl
File metadata and controls
50 lines (39 loc) · 939 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
38
39
40
41
42
43
44
45
46
47
48
49
50
{{- /* vi:set ft=gotmpl */ -}}
{{ .FullName }}
{{- if .Summary }} - {{ .Summary }}{{ end }}
{{- if .Description }}
{{ .Description }}
{{- end }}
{{- if .VisibleCommands }}
Commands:
{{- range .VisibleCommands }}
{{ padCommand .Name }}
{{- if .Summary }}{{ .Summary }}{{ end }}
{{- end}}
{{- end }}
{{- if .VisibleFlags}}
Options:
{{- $lastIndex := -1 }}
{{- range $i, $_ := .VisibleFlags }}
{{- $lastIndex = $i }}
{{- end }}
{{- range $i, $flag := .VisibleFlags }}
{{- with $flag }}
{{ .Usage }}
{{- if .Description }}
{{ .Description | pad 10 }}
{{- if or .Env .Default .Deprecated }}{{ print "\n" }}{{ end }}
{{- end }}
{{- if .Deprecated }}
{{ pad 10 "" }}Deprecated: {{ .Deprecated }}
{{- end }}
{{- if .Default }}
{{ pad 10 "" }}Default: {{ .Default }}
{{- end }}
{{- if .Env }}
{{ pad 10 "" }}Env: {{ .Env | join ", " }}
{{- end }}
{{- if ne $i $lastIndex }}{{ print "\n" }}{{ end }}
{{- end }}
{{- end }}
{{- end }}