Skip to content

Commit 44818dd

Browse files
mundrymr-karan
authored andcommitted
chore: document completions subcommand in --help output
1 parent 24dadc0 commit 44818dd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cmd/doggo/help.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ var appHelpTextTemplate = `{{ "NAME" | color "" "heading" }}:
3434
{{ printf "%-12s" $opt.Scheme | color "yellow" "" }}{{ printf "%-68s" $opt.Example }}{{ $opt.Description | color "cyan" "" }}
3535
{{- end }}
3636
37+
{{ "SUBCOMMANDS" | color "" "heading" }}:
38+
{{- range $opt := .Subcommands }}
39+
{{ printf "%-30s" $opt.Flag | color "yellow" "" }}{{ $opt.Description }}
40+
{{- end }}
41+
3742
{{ "QUERY OPTIONS" | color "" "heading" }}:
3843
{{- range $opt := .QueryOptions }}
3944
{{ printf "%-30s" $opt.Flag | color "yellow" "" }}{{ $opt.Description }}
@@ -93,6 +98,9 @@ func renderCustomHelp() {
9398
{"@sdns://", "initiates a DNSCrypt or DoH query using a DNS stamp.", ""},
9499
{"@quic://", "initiates a DOQ query.", ""},
95100
},
101+
"Subcommands": []Option{
102+
{"completions [bash|zsh|fish]", "Generate the shell completion script for the specified shell."},
103+
},
96104
"QueryOptions": []Option{
97105
{"-q, --query=HOSTNAME", "Hostname to query the DNS records for (eg mrkaran.dev)."},
98106
{"-t, --type=TYPE", "Type of the DNS Record (A, MX, NS etc)."},

0 commit comments

Comments
 (0)