forked from SimFG/etcd-analysis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
etcdctl+.ts
185 lines (185 loc) · 7.21 KB
/
etcdctl+.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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
const completionSpec: Fig.Spec = {
name: "etcdctl+",
description: "short tips for the command",
subcommands: [
{ name: ["clear"], description: "Clear all etcd data" },
{
name: ["completion"],
description: "Generate the autocompletion script for the specified shell",
subcommands: [
{
name: ["bash"],
description: "Generate the autocompletion script for bash",
options: [
{
name: ["--no-descriptions"],
description: "disable completion descriptions",
},
],
},
{
name: ["fish"],
description: "Generate the autocompletion script for fish",
options: [
{
name: ["--no-descriptions"],
description: "disable completion descriptions",
},
],
},
{
name: ["powershell"],
description: "Generate the autocompletion script for powershell",
options: [
{
name: ["--no-descriptions"],
description: "disable completion descriptions",
},
],
},
{
name: ["zsh"],
description: "Generate the autocompletion script for zsh",
options: [
{
name: ["--no-descriptions"],
description: "disable completion descriptions",
},
],
},
],
},
{
name: ["decode"],
description: "decode the base64-encoded value",
options: [
{
name: ["--value"],
description: "the base64-encoded value",
args: [{ name: "value" }],
},
],
},
{
name: ["distribute"],
description: "Show the data distribution of etcd",
options: [
{
name: ["--bucket"],
description: "Bucket Count",
args: [{ name: "bucket", default: "5", suggestions: ["5", "6", "7", "8", "9", "10"] }],
},
{
name: ["--type"],
description: "Distribution basis; key, value or kv",
args: [{ name: "type", default: "key", suggestions: ["key", "value", "kv"] }],
},
],
},
{
name: ["find"],
description: "find the key from all etcd data",
options: [
{
name: ["--key"],
description: "Show the data like the key",
args: [{ name: "key" }],
},
{
name: ["--limit"],
description: "The limit of the show keys",
args: [{ name: "limit", default: "10", suggestions: ["5", "10", "15", "20"] }],
},
{ name: ["--value"], description: "Show the value or not" },
],
},
{ name: ["leader"], description: "Get the leader node info" },
{
name: ["look"],
description: "Look all etcd data",
options: [
{
name: ["--filter"],
description: "The filter attribute",
args: [{ name: "filter", default: "none", suggestions: ["none", "key", "value", "kv"] }],
},
{
name: ["--filter-max"],
description: "The filter max value",
args: [{ name: "filter-max", default: "-1" }],
},
{
name: ["--filter-min"],
description: "The filter min value",
args: [{ name: "filter-min", default: "-1" }],
},
{
name: ["--hang"],
description:
"Get updates periodically, only '--write-out=file' takes effect",
args: [{ name: "hang", default: "false", suggestions: ["false", "true"] }],
},
{
name: ["--hang-interval"],
description: "Update interval, and the unit is 's'",
args: [{ name: "hang-interval", default: "2", suggestions: ["1", "2", "3"] }],
},
{ name: ["--show-value"], description: "Show the value or not" },
{
name: ["--write-out"],
description: "The looking type",
args: [{ name: "write-out", default: "stdout", suggestions: ["stdout", "file"] }],
},
],
},
{
name: ["help"],
description: "Help about any command",
subcommands: [
{ name: ["clear"], description: "Clear all etcd data" },
{
name: ["completion"],
description:
"Generate the autocompletion script for the specified shell",
subcommands: [
{
name: ["bash"],
description: "Generate the autocompletion script for bash",
},
{
name: ["fish"],
description: "Generate the autocompletion script for fish",
},
{
name: ["powershell"],
description: "Generate the autocompletion script for powershell",
},
{
name: ["zsh"],
description: "Generate the autocompletion script for zsh",
},
],
},
{ name: ["decode"], description: "decode the base64-encoded value" },
{
name: ["distribute"],
description: "Show the data distribution of etcd",
},
{ name: ["find"], description: "find the key from all etcd data" },
{ name: ["leader"], description: "Get the leader node info" },
{ name: ["look"], description: "Look all etcd data" },
],
},
],
options: [
{
name: ["--Endpoints"],
description: "etcd connect Endpoints",
isPersistent: true,
isRepeatable: true,
args: [{ name: "Endpoints", default: "[127.0.0.1:2379]" }],
},
{ name: ["--help", "-h"], description: "Display help", isPersistent: true },
],
};
export default completionSpec;