-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
Copy pathdog.ts
144 lines (141 loc) · 3.03 KB
/
dog.ts
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
const args: Fig.SingleOrArray<Fig.Arg> = {
name: "arguments",
description: "Human-readable host names, nameservers, types, or classes",
};
const options: Fig.Option[] = [
{
name: ["-q", "--query"],
description: "Host name or IP address to query",
args: { name: "HOST" },
},
{
name: ["-t", "--type"],
description: "Type of the DNS record being queried (A, MX, NS...)",
args: { name: "TYPE" },
},
{
name: ["-n", "--nameserver"],
description: "Address of the nameserver to send packets to",
args: { name: "ADDR" },
},
{
name: "-class",
description: "Network class of the DNS record being queried (IN, CH, HS)",
args: { name: "CLASS" },
},
{
name: "--edns",
description: "Whether to OPT in to EDNS (disable, hide, show)",
args: { name: "NUMBER" },
},
{
name: "--txid",
description: "Set the transaction ID to a specific value",
args: { name: "CLASS" },
},
{
name: "-Z",
description: "Set uncommon protocol-level tweaks",
args: { name: "TWEAKS" },
},
{
name: ["-U", "--udp"],
description: "Use the DNS protocol over UDP",
},
{
name: ["-T", "--tcp"],
description: "Use the DNS protocol over TCP",
},
{
name: ["-S", "--tls"],
description: "Use the DNS-over-TLS protocol",
},
{
name: ["-H", "--https"],
description: "Use the DNS-over-HTTPS protocol",
},
{
name: ["-1", "--short"],
description: "Short mode: display nothing but the first result",
},
{
name: ["-J", "--json"],
description: "Display the output as JSON",
},
{
name: "--color",
description: "When to colourise the output (always, automatic, never)",
args: [args, { name: "WHEN" }],
},
{
name: "--seconds",
description: "Do not format durations, display them as seconds",
},
{
name: "--time",
description: "Print how long the response took to arrive",
},
];
const completionSpec: Fig.Spec = {
name: "dog",
description: "A command-line DNS client",
args,
options,
subcommands: [
{
name: "A",
description: "Query Domain A Record",
options,
args,
},
{
name: "MX",
description: "Query Domain MX Record",
options,
args,
},
{
name: "CNAME",
description: "Query Domain CNAME Record",
options,
args,
},
{
name: "TXT",
description: "Query Domain TXT Record",
options,
args,
},
{
name: "NS",
description: "Query NS Record",
options,
args,
},
{
name: "SOA",
description: "Query SOA Record",
options,
args,
},
{
name: "TTL",
description: "Query TTL Record",
options,
args,
},
{
name: "ANY +noall +answer",
description: "Query ALL DNS Records",
options,
args,
},
{
name: "+nocomments +noquestion +noauthority +noadditional +nostats",
description: "Query only answer section",
options,
args,
},
],
};
export default completionSpec;