line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::Memcached::CLI::Help; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
6
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
46
|
|
4
|
2
|
|
|
2
|
|
6
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
44
|
|
5
|
2
|
|
|
2
|
|
32
|
use 5.008_001; |
|
2
|
|
|
|
|
4
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
6
|
use version; our $VERSION = 'v0.9.4'; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
6
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our @COMMANDS_INFO = ( |
10
|
|
|
|
|
|
|
+{ |
11
|
|
|
|
|
|
|
command => 'help', |
12
|
|
|
|
|
|
|
summary => 'Show help (this)', |
13
|
|
|
|
|
|
|
}, |
14
|
|
|
|
|
|
|
+{ |
15
|
|
|
|
|
|
|
command => 'version', |
16
|
|
|
|
|
|
|
summary => 'Show server version', |
17
|
|
|
|
|
|
|
}, |
18
|
|
|
|
|
|
|
+{ |
19
|
|
|
|
|
|
|
command => 'quit', |
20
|
|
|
|
|
|
|
summary => 'Exit', |
21
|
|
|
|
|
|
|
}, |
22
|
|
|
|
|
|
|
+{ |
23
|
|
|
|
|
|
|
command => 'display', |
24
|
|
|
|
|
|
|
summary => 'Display slabs info', |
25
|
|
|
|
|
|
|
}, |
26
|
|
|
|
|
|
|
+{ |
27
|
|
|
|
|
|
|
command => 'stats', |
28
|
|
|
|
|
|
|
summary => 'Show stats', |
29
|
|
|
|
|
|
|
description => <<'EODESC', |
30
|
|
|
|
|
|
|
Usage: |
31
|
|
|
|
|
|
|
> stats [] |
32
|
|
|
|
|
|
|
> stats # show all stats |
33
|
|
|
|
|
|
|
> stats (hit|miss) # filter by REGEXP |
34
|
|
|
|
|
|
|
EODESC |
35
|
|
|
|
|
|
|
}, |
36
|
|
|
|
|
|
|
+{ |
37
|
|
|
|
|
|
|
command => 'settings', |
38
|
|
|
|
|
|
|
summary => 'Show settings', |
39
|
|
|
|
|
|
|
description => <<'EODESC', |
40
|
|
|
|
|
|
|
Usage: |
41
|
|
|
|
|
|
|
> settings [] |
42
|
|
|
|
|
|
|
> settings # show all stats |
43
|
|
|
|
|
|
|
> settings ^(lru|slab) # filter by REGEXP |
44
|
|
|
|
|
|
|
EODESC |
45
|
|
|
|
|
|
|
}, |
46
|
|
|
|
|
|
|
+{ |
47
|
|
|
|
|
|
|
command => 'cachedump', |
48
|
|
|
|
|
|
|
summary => 'Show cachedump of specified slab', |
49
|
|
|
|
|
|
|
description => <<'EODESC', |
50
|
|
|
|
|
|
|
Usage: |
51
|
|
|
|
|
|
|
> cachedump [] |
52
|
|
|
|
|
|
|
> cachedump 1 10 |
53
|
|
|
|
|
|
|
> cachedump 3 # show default number of items |
54
|
|
|
|
|
|
|
EODESC |
55
|
|
|
|
|
|
|
}, |
56
|
|
|
|
|
|
|
+{ |
57
|
|
|
|
|
|
|
command => 'detaildump', |
58
|
|
|
|
|
|
|
summary => 'Show detail dump', |
59
|
|
|
|
|
|
|
description => <<'EODESC', |
60
|
|
|
|
|
|
|
Description: |
61
|
|
|
|
|
|
|
Report statistics about data access using KEY prefix. The default separator |
62
|
|
|
|
|
|
|
for prefix is ':'. |
63
|
|
|
|
|
|
|
If you have not enabled reporting at Memcached start-up, run "detail on". |
64
|
|
|
|
|
|
|
See man memcached(1) for details. |
65
|
|
|
|
|
|
|
EODESC |
66
|
|
|
|
|
|
|
}, |
67
|
|
|
|
|
|
|
+{ |
68
|
|
|
|
|
|
|
command => 'detail', |
69
|
|
|
|
|
|
|
summary => 'Enable/Disable detail dump', |
70
|
|
|
|
|
|
|
description => <<'EODESC', |
71
|
|
|
|
|
|
|
Usage: |
72
|
|
|
|
|
|
|
> detail on |
73
|
|
|
|
|
|
|
> detail off |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
Description: |
76
|
|
|
|
|
|
|
See "\h detaildump" |
77
|
|
|
|
|
|
|
EODESC |
78
|
|
|
|
|
|
|
}, |
79
|
|
|
|
|
|
|
+{ |
80
|
|
|
|
|
|
|
command => 'dump_all', |
81
|
|
|
|
|
|
|
summary => 'Dump whole server data', |
82
|
|
|
|
|
|
|
}, |
83
|
|
|
|
|
|
|
+{ |
84
|
|
|
|
|
|
|
command => 'restore_dump', |
85
|
|
|
|
|
|
|
summary => 'Restore data from dump', |
86
|
|
|
|
|
|
|
description => <<'EODESC', |
87
|
|
|
|
|
|
|
Usage: |
88
|
|
|
|
|
|
|
> restore_dump FILE |
89
|
|
|
|
|
|
|
EODESC |
90
|
|
|
|
|
|
|
}, |
91
|
|
|
|
|
|
|
+{ |
92
|
|
|
|
|
|
|
command => 'randomset', |
93
|
|
|
|
|
|
|
summary => 'Generate sample data and SET them', |
94
|
|
|
|
|
|
|
description => <<'EODESC', |
95
|
|
|
|
|
|
|
Usage: |
96
|
|
|
|
|
|
|
> randomset [ [ [ []]]] |
97
|
|
|
|
|
|
|
> randomset # generate 100 data |
98
|
|
|
|
|
|
|
> randomset 50 # generate 50 data |
99
|
|
|
|
|
|
|
> randomset 50 1024 # data length: 1-1024B |
100
|
|
|
|
|
|
|
> randomset 50 1024 256 # data length: 256-1024B |
101
|
|
|
|
|
|
|
> randomset 50 1024 256 sample1 # prefix 'sample1:' |
102
|
|
|
|
|
|
|
EODESC |
103
|
|
|
|
|
|
|
}, |
104
|
|
|
|
|
|
|
+{ |
105
|
|
|
|
|
|
|
command => 'get', |
106
|
|
|
|
|
|
|
summary => 'Get data by KEYs', |
107
|
|
|
|
|
|
|
description => <<'EODESC', |
108
|
|
|
|
|
|
|
Usage: |
109
|
|
|
|
|
|
|
> get [ ...] |
110
|
|
|
|
|
|
|
EODESC |
111
|
|
|
|
|
|
|
}, |
112
|
|
|
|
|
|
|
+{ |
113
|
|
|
|
|
|
|
command => 'gets', |
114
|
|
|
|
|
|
|
summary => 'Get data by KEYs with cas', |
115
|
|
|
|
|
|
|
description => <<'EODESC', |
116
|
|
|
|
|
|
|
Usage: |
117
|
|
|
|
|
|
|
> gets [ ...] |
118
|
|
|
|
|
|
|
EODESC |
119
|
|
|
|
|
|
|
}, |
120
|
|
|
|
|
|
|
+{ |
121
|
|
|
|
|
|
|
command => 'set', |
122
|
|
|
|
|
|
|
summary => 'Set data by KEY VALUE', |
123
|
|
|
|
|
|
|
description => <<'EODESC', |
124
|
|
|
|
|
|
|
Usage: |
125
|
|
|
|
|
|
|
> set [ []] |
126
|
|
|
|
|
|
|
> set mykey1 MyValue1 |
127
|
|
|
|
|
|
|
> set mykey2 MyValue2 0 # Never expires. Default |
128
|
|
|
|
|
|
|
> set mykey3 MyValue3 120 1 |
129
|
|
|
|
|
|
|
EODESC |
130
|
|
|
|
|
|
|
}, |
131
|
|
|
|
|
|
|
+{ |
132
|
|
|
|
|
|
|
command => 'add', |
133
|
|
|
|
|
|
|
summary => 'Add data by KEY VALUE', |
134
|
|
|
|
|
|
|
description => <<'EODESC', |
135
|
|
|
|
|
|
|
Description: |
136
|
|
|
|
|
|
|
Store data if server has no data with the KEY. |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
Usage: |
139
|
|
|
|
|
|
|
> add [ []] |
140
|
|
|
|
|
|
|
> add mykey1 MyValue1 |
141
|
|
|
|
|
|
|
> add mykey2 MyValue2 0 # Never expires. Default |
142
|
|
|
|
|
|
|
> add mykey3 MyValue3 120 1 |
143
|
|
|
|
|
|
|
EODESC |
144
|
|
|
|
|
|
|
}, |
145
|
|
|
|
|
|
|
+{ |
146
|
|
|
|
|
|
|
command => 'replace', |
147
|
|
|
|
|
|
|
summary => 'Replace data by KEY VALUE', |
148
|
|
|
|
|
|
|
description => <<'EODESC', |
149
|
|
|
|
|
|
|
Description: |
150
|
|
|
|
|
|
|
Overwrite data if server has data with the KEY. |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
Usage: |
153
|
|
|
|
|
|
|
> replace [ []] |
154
|
|
|
|
|
|
|
> replace mykey1 MyValue1 |
155
|
|
|
|
|
|
|
> replace mykey2 MyValue2 0 # Never expires. Default |
156
|
|
|
|
|
|
|
> replace mykey3 MyValue3 120 1 |
157
|
|
|
|
|
|
|
EODESC |
158
|
|
|
|
|
|
|
}, |
159
|
|
|
|
|
|
|
+{ |
160
|
|
|
|
|
|
|
command => 'append', |
161
|
|
|
|
|
|
|
summary => 'Append data by KEY VALUE', |
162
|
|
|
|
|
|
|
description => <<'EODESC', |
163
|
|
|
|
|
|
|
Description: |
164
|
|
|
|
|
|
|
Append VALUE after existing data which has specified KEY. |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
Usage: |
167
|
|
|
|
|
|
|
> append |
168
|
|
|
|
|
|
|
> append mykey MySuffix |
169
|
|
|
|
|
|
|
EODESC |
170
|
|
|
|
|
|
|
}, |
171
|
|
|
|
|
|
|
+{ |
172
|
|
|
|
|
|
|
command => 'prepend', |
173
|
|
|
|
|
|
|
summary => 'Prepend data by KEY VALUE', |
174
|
|
|
|
|
|
|
description => <<'EODESC', |
175
|
|
|
|
|
|
|
Description: |
176
|
|
|
|
|
|
|
Put VALUE before existing data which has specified KEY. |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
Usage: |
179
|
|
|
|
|
|
|
> prepend |
180
|
|
|
|
|
|
|
> prepend mykey MyPrefix |
181
|
|
|
|
|
|
|
EODESC |
182
|
|
|
|
|
|
|
}, |
183
|
|
|
|
|
|
|
+{ |
184
|
|
|
|
|
|
|
command => 'cas', |
185
|
|
|
|
|
|
|
summary => 'Set data by KEY VALUE with CAS', |
186
|
|
|
|
|
|
|
description => <<'EODESC', |
187
|
|
|
|
|
|
|
Description: |
188
|
|
|
|
|
|
|
Store data as specified (KEY, VALUE) if CAS of data is not modified. |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
Usage: |
191
|
|
|
|
|
|
|
> cas [ []] |
192
|
|
|
|
|
|
|
> cas mykey1 MyValue1 1 |
193
|
|
|
|
|
|
|
> cas mykey2 MyValue2 26 0 # Never expires. Default |
194
|
|
|
|
|
|
|
> cas mykey3 MyValue3 355 120 1 |
195
|
|
|
|
|
|
|
EODESC |
196
|
|
|
|
|
|
|
}, |
197
|
|
|
|
|
|
|
+{ |
198
|
|
|
|
|
|
|
command => 'touch', |
199
|
|
|
|
|
|
|
summary => 'Update data with new EXPIRE', |
200
|
|
|
|
|
|
|
description => <<'EODESC', |
201
|
|
|
|
|
|
|
Usage: |
202
|
|
|
|
|
|
|
> touch |
203
|
|
|
|
|
|
|
> touch foo 300 # will expire in 5 min |
204
|
|
|
|
|
|
|
> touch bar 0 # will never expire |
205
|
|
|
|
|
|
|
EODESC |
206
|
|
|
|
|
|
|
}, |
207
|
|
|
|
|
|
|
+{ |
208
|
|
|
|
|
|
|
command => 'incr', |
209
|
|
|
|
|
|
|
summary => 'Add numeric VALUE for a data', |
210
|
|
|
|
|
|
|
description => <<'EODESC', |
211
|
|
|
|
|
|
|
Usage: |
212
|
|
|
|
|
|
|
> incr |
213
|
|
|
|
|
|
|
> incr foo 1 |
214
|
|
|
|
|
|
|
EODESC |
215
|
|
|
|
|
|
|
}, |
216
|
|
|
|
|
|
|
+{ |
217
|
|
|
|
|
|
|
command => 'decr', |
218
|
|
|
|
|
|
|
summary => 'Reduce numeric VALUE from a data', |
219
|
|
|
|
|
|
|
description => <<'EODESC', |
220
|
|
|
|
|
|
|
Usage: |
221
|
|
|
|
|
|
|
> decr |
222
|
|
|
|
|
|
|
> decr foo 1 |
223
|
|
|
|
|
|
|
EODESC |
224
|
|
|
|
|
|
|
}, |
225
|
|
|
|
|
|
|
+{ |
226
|
|
|
|
|
|
|
command => 'delete', |
227
|
|
|
|
|
|
|
summary => 'Delete data by KEY', |
228
|
|
|
|
|
|
|
description => <<'EODESC', |
229
|
|
|
|
|
|
|
Usage: |
230
|
|
|
|
|
|
|
> delete |
231
|
|
|
|
|
|
|
EODESC |
232
|
|
|
|
|
|
|
}, |
233
|
|
|
|
|
|
|
+{ |
234
|
|
|
|
|
|
|
command => 'flush_all', |
235
|
|
|
|
|
|
|
summary => 'Invalidate whole data', |
236
|
|
|
|
|
|
|
description => <<'EODESC', |
237
|
|
|
|
|
|
|
Usage: |
238
|
|
|
|
|
|
|
> flush_all [] |
239
|
|
|
|
|
|
|
> flush_all # Invalidate immediately |
240
|
|
|
|
|
|
|
> flush_all 60 # Invalidate after 60 seconds |
241
|
|
|
|
|
|
|
EODESC |
242
|
|
|
|
|
|
|
}, |
243
|
|
|
|
|
|
|
+{ |
244
|
|
|
|
|
|
|
command => 'call', |
245
|
|
|
|
|
|
|
summary => 'Execute any command', |
246
|
|
|
|
|
|
|
description => <<'EODESC', |
247
|
|
|
|
|
|
|
Description: |
248
|
|
|
|
|
|
|
This command executes any commands given as arguments. |
249
|
|
|
|
|
|
|
Usage: |
250
|
|
|
|
|
|
|
> call version |
251
|
|
|
|
|
|
|
> call get myKey |
252
|
|
|
|
|
|
|
> call stats conns |
253
|
|
|
|
|
|
|
EODESC |
254
|
|
|
|
|
|
|
}, |
255
|
|
|
|
|
|
|
); |
256
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
1; |
258
|
|
|
|
|
|
|
__END__ |