coa 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- package/.npmignore +6 -0
- package/.nyc_output/1f2a0db5a6d6559149db56d397f47cfc.json +1 -0
- package/.nyc_output/75b82d38f2186df930141082076e11c6.json +1 -0
- package/.travis.yml +9 -0
- package/GNUmakefile +34 -0
- package/README.md +1 -19
- package/coverage/base.css +212 -0
- package/coverage/coa/index.html +93 -0
- package/coverage/coa/index.js.html +68 -0
- package/coverage/coa/lib/arg.js.html +239 -0
- package/coverage/coa/lib/cmd.js.html +1556 -0
- package/coverage/coa/lib/coaobject.js.html +365 -0
- package/coverage/coa/lib/coaparam.js.html +440 -0
- package/coverage/coa/lib/color.js.html +131 -0
- package/coverage/coa/lib/completion.js.html +593 -0
- package/coverage/coa/lib/index.html +197 -0
- package/coverage/coa/lib/index.js.html +107 -0
- package/coverage/coa/lib/opt.js.html +524 -0
- package/coverage/coa/lib/shell.js.html +107 -0
- package/coverage/index.html +106 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +1 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +158 -0
- package/index.js +1 -1
- package/lib/arg.js +161 -44
- package/lib/cmd.js +547 -434
- package/lib/color.js +22 -19
- package/lib/completion.js +119 -161
- package/lib/index.js +10 -14
- package/lib/opt.js +313 -130
- package/lib/shell.js +13 -13
- package/package.json +14 -19
- package/qq.js +17 -0
- package/src/arg.coffee +130 -0
- package/src/cmd.coffee +456 -0
- package/src/color.coffee +25 -0
- package/src/completion.coffee +156 -0
- package/src/index.coffee +5 -0
- package/src/opt.coffee +243 -0
- package/src/shell.coffee +10 -0
- package/test/coa.js +496 -0
- package/test/mocha.opts +2 -0
- package/test/shell-test.js +60 -0
- package/tests/api-h.js +9 -0
- package/tests/h.js +6 -0
- package/LICENSE +0 -21
- package/lib/coaobject.js +0 -100
- package/lib/coaparam.js +0 -125
@@ -0,0 +1,524 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<title>Code coverage report for coa/lib/opt.js</title>
|
5
|
+
<meta charset="utf-8" />
|
6
|
+
<link rel="stylesheet" href="../../prettify.css" />
|
7
|
+
<link rel="stylesheet" href="../../base.css" />
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
9
|
+
<style type='text/css'>
|
10
|
+
.coverage-summary .sorter {
|
11
|
+
background-image: url(../../sort-arrow-sprite.png);
|
12
|
+
}
|
13
|
+
</style>
|
14
|
+
</head>
|
15
|
+
<body>
|
16
|
+
<div class='wrapper'>
|
17
|
+
<div class='pad1'>
|
18
|
+
<h1>
|
19
|
+
<a href="../../index.html">All files</a> / <a href="index.html">coa/lib</a> opt.js
|
20
|
+
</h1>
|
21
|
+
<div class='clearfix'>
|
22
|
+
<div class='fl pad1y space-right2'>
|
23
|
+
<span class="strong">91.84% </span>
|
24
|
+
<span class="quiet">Statements</span>
|
25
|
+
<span class='fraction'>45/49</span>
|
26
|
+
</div>
|
27
|
+
<div class='fl pad1y space-right2'>
|
28
|
+
<span class="strong">72.73% </span>
|
29
|
+
<span class="quiet">Branches</span>
|
30
|
+
<span class='fraction'>16/22</span>
|
31
|
+
</div>
|
32
|
+
<div class='fl pad1y space-right2'>
|
33
|
+
<span class="strong">100% </span>
|
34
|
+
<span class="quiet">Functions</span>
|
35
|
+
<span class='fraction'>14/14</span>
|
36
|
+
</div>
|
37
|
+
<div class='fl pad1y space-right2'>
|
38
|
+
<span class="strong">95.65% </span>
|
39
|
+
<span class="quiet">Lines</span>
|
40
|
+
<span class='fraction'>44/46</span>
|
41
|
+
</div>
|
42
|
+
</div>
|
43
|
+
</div>
|
44
|
+
<div class='status-line high'></div>
|
45
|
+
<pre><table class="coverage">
|
46
|
+
<tr><td class="line-count quiet">1
|
47
|
+
2
|
48
|
+
3
|
49
|
+
4
|
50
|
+
5
|
51
|
+
6
|
52
|
+
7
|
53
|
+
8
|
54
|
+
9
|
55
|
+
10
|
56
|
+
11
|
57
|
+
12
|
58
|
+
13
|
59
|
+
14
|
60
|
+
15
|
61
|
+
16
|
62
|
+
17
|
63
|
+
18
|
64
|
+
19
|
65
|
+
20
|
66
|
+
21
|
67
|
+
22
|
68
|
+
23
|
69
|
+
24
|
70
|
+
25
|
71
|
+
26
|
72
|
+
27
|
73
|
+
28
|
74
|
+
29
|
75
|
+
30
|
76
|
+
31
|
77
|
+
32
|
78
|
+
33
|
79
|
+
34
|
80
|
+
35
|
81
|
+
36
|
82
|
+
37
|
83
|
+
38
|
84
|
+
39
|
85
|
+
40
|
86
|
+
41
|
87
|
+
42
|
88
|
+
43
|
89
|
+
44
|
90
|
+
45
|
91
|
+
46
|
92
|
+
47
|
93
|
+
48
|
94
|
+
49
|
95
|
+
50
|
96
|
+
51
|
97
|
+
52
|
98
|
+
53
|
99
|
+
54
|
100
|
+
55
|
101
|
+
56
|
102
|
+
57
|
103
|
+
58
|
104
|
+
59
|
105
|
+
60
|
106
|
+
61
|
107
|
+
62
|
108
|
+
63
|
109
|
+
64
|
110
|
+
65
|
111
|
+
66
|
112
|
+
67
|
113
|
+
68
|
114
|
+
69
|
115
|
+
70
|
116
|
+
71
|
117
|
+
72
|
118
|
+
73
|
119
|
+
74
|
120
|
+
75
|
121
|
+
76
|
122
|
+
77
|
123
|
+
78
|
124
|
+
79
|
125
|
+
80
|
126
|
+
81
|
127
|
+
82
|
128
|
+
83
|
129
|
+
84
|
130
|
+
85
|
131
|
+
86
|
132
|
+
87
|
133
|
+
88
|
134
|
+
89
|
135
|
+
90
|
136
|
+
91
|
137
|
+
92
|
138
|
+
93
|
139
|
+
94
|
140
|
+
95
|
141
|
+
96
|
142
|
+
97
|
143
|
+
98
|
144
|
+
99
|
145
|
+
100
|
146
|
+
101
|
147
|
+
102
|
148
|
+
103
|
149
|
+
104
|
150
|
+
105
|
151
|
+
106
|
152
|
+
107
|
153
|
+
108
|
154
|
+
109
|
155
|
+
110
|
156
|
+
111
|
157
|
+
112
|
158
|
+
113
|
159
|
+
114
|
160
|
+
115
|
161
|
+
116
|
162
|
+
117
|
163
|
+
118
|
164
|
+
119
|
165
|
+
120
|
166
|
+
121
|
167
|
+
122
|
168
|
+
123
|
169
|
+
124
|
170
|
+
125
|
171
|
+
126
|
172
|
+
127
|
173
|
+
128
|
174
|
+
129
|
175
|
+
130
|
176
|
+
131
|
177
|
+
132
|
178
|
+
133
|
179
|
+
134
|
180
|
+
135
|
181
|
+
136
|
182
|
+
137
|
183
|
+
138
|
184
|
+
139
|
185
|
+
140
|
186
|
+
141
|
187
|
+
142
|
188
|
+
143
|
189
|
+
144
|
190
|
+
145
|
191
|
+
146
|
192
|
+
147
|
193
|
+
148
|
194
|
+
149
|
195
|
+
150
|
196
|
+
151
|
197
|
+
152
|
198
|
+
153
|
199
|
+
154</td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
200
|
+
<span class="cline-any cline-neutral"> </span>
|
201
|
+
<span class="cline-any cline-neutral"> </span>
|
202
|
+
<span class="cline-any cline-yes">1x</span>
|
203
|
+
<span class="cline-any cline-neutral"> </span>
|
204
|
+
<span class="cline-any cline-yes">1x</span>
|
205
|
+
<span class="cline-any cline-yes">1x</span>
|
206
|
+
<span class="cline-any cline-neutral"> </span>
|
207
|
+
<span class="cline-any cline-neutral"> </span>
|
208
|
+
<span class="cline-any cline-neutral"> </span>
|
209
|
+
<span class="cline-any cline-neutral"> </span>
|
210
|
+
<span class="cline-any cline-neutral"> </span>
|
211
|
+
<span class="cline-any cline-neutral"> </span>
|
212
|
+
<span class="cline-any cline-neutral"> </span>
|
213
|
+
<span class="cline-any cline-neutral"> </span>
|
214
|
+
<span class="cline-any cline-neutral"> </span>
|
215
|
+
<span class="cline-any cline-neutral"> </span>
|
216
|
+
<span class="cline-any cline-yes">1x</span>
|
217
|
+
<span class="cline-any cline-neutral"> </span>
|
218
|
+
<span class="cline-any cline-neutral"> </span>
|
219
|
+
<span class="cline-any cline-neutral"> </span>
|
220
|
+
<span class="cline-any cline-neutral"> </span>
|
221
|
+
<span class="cline-any cline-neutral"> </span>
|
222
|
+
<span class="cline-any cline-yes">16x</span>
|
223
|
+
<span class="cline-any cline-neutral"> </span>
|
224
|
+
<span class="cline-any cline-yes">16x</span>
|
225
|
+
<span class="cline-any cline-yes">16x</span>
|
226
|
+
<span class="cline-any cline-yes">16x</span>
|
227
|
+
<span class="cline-any cline-yes">16x</span>
|
228
|
+
<span class="cline-any cline-yes">16x</span>
|
229
|
+
<span class="cline-any cline-neutral"> </span>
|
230
|
+
<span class="cline-any cline-neutral"> </span>
|
231
|
+
<span class="cline-any cline-neutral"> </span>
|
232
|
+
<span class="cline-any cline-neutral"> </span>
|
233
|
+
<span class="cline-any cline-neutral"> </span>
|
234
|
+
<span class="cline-any cline-neutral"> </span>
|
235
|
+
<span class="cline-any cline-neutral"> </span>
|
236
|
+
<span class="cline-any cline-neutral"> </span>
|
237
|
+
<span class="cline-any cline-neutral"> </span>
|
238
|
+
<span class="cline-any cline-yes">7x</span>
|
239
|
+
<span class="cline-any cline-yes">7x</span>
|
240
|
+
<span class="cline-any cline-yes">7x</span>
|
241
|
+
<span class="cline-any cline-neutral"> </span>
|
242
|
+
<span class="cline-any cline-neutral"> </span>
|
243
|
+
<span class="cline-any cline-neutral"> </span>
|
244
|
+
<span class="cline-any cline-neutral"> </span>
|
245
|
+
<span class="cline-any cline-neutral"> </span>
|
246
|
+
<span class="cline-any cline-neutral"> </span>
|
247
|
+
<span class="cline-any cline-neutral"> </span>
|
248
|
+
<span class="cline-any cline-neutral"> </span>
|
249
|
+
<span class="cline-any cline-neutral"> </span>
|
250
|
+
<span class="cline-any cline-yes">9x</span>
|
251
|
+
<span class="cline-any cline-yes">9x</span>
|
252
|
+
<span class="cline-any cline-yes">9x</span>
|
253
|
+
<span class="cline-any cline-neutral"> </span>
|
254
|
+
<span class="cline-any cline-neutral"> </span>
|
255
|
+
<span class="cline-any cline-neutral"> </span>
|
256
|
+
<span class="cline-any cline-neutral"> </span>
|
257
|
+
<span class="cline-any cline-neutral"> </span>
|
258
|
+
<span class="cline-any cline-neutral"> </span>
|
259
|
+
<span class="cline-any cline-neutral"> </span>
|
260
|
+
<span class="cline-any cline-neutral"> </span>
|
261
|
+
<span class="cline-any cline-yes">1x</span>
|
262
|
+
<span class="cline-any cline-yes">1x</span>
|
263
|
+
<span class="cline-any cline-neutral"> </span>
|
264
|
+
<span class="cline-any cline-neutral"> </span>
|
265
|
+
<span class="cline-any cline-neutral"> </span>
|
266
|
+
<span class="cline-any cline-neutral"> </span>
|
267
|
+
<span class="cline-any cline-neutral"> </span>
|
268
|
+
<span class="cline-any cline-neutral"> </span>
|
269
|
+
<span class="cline-any cline-neutral"> </span>
|
270
|
+
<span class="cline-any cline-neutral"> </span>
|
271
|
+
<span class="cline-any cline-neutral"> </span>
|
272
|
+
<span class="cline-any cline-yes">1x</span>
|
273
|
+
<span class="cline-any cline-yes">1x</span>
|
274
|
+
<span class="cline-any cline-neutral"> </span>
|
275
|
+
<span class="cline-any cline-neutral"> </span>
|
276
|
+
<span class="cline-any cline-neutral"> </span>
|
277
|
+
<span class="cline-any cline-neutral"> </span>
|
278
|
+
<span class="cline-any cline-neutral"> </span>
|
279
|
+
<span class="cline-any cline-neutral"> </span>
|
280
|
+
<span class="cline-any cline-neutral"> </span>
|
281
|
+
<span class="cline-any cline-neutral"> </span>
|
282
|
+
<span class="cline-any cline-neutral"> </span>
|
283
|
+
<span class="cline-any cline-neutral"> </span>
|
284
|
+
<span class="cline-any cline-neutral"> </span>
|
285
|
+
<span class="cline-any cline-neutral"> </span>
|
286
|
+
<span class="cline-any cline-neutral"> </span>
|
287
|
+
<span class="cline-any cline-neutral"> </span>
|
288
|
+
<span class="cline-any cline-neutral"> </span>
|
289
|
+
<span class="cline-any cline-neutral"> </span>
|
290
|
+
<span class="cline-any cline-neutral"> </span>
|
291
|
+
<span class="cline-any cline-neutral"> </span>
|
292
|
+
<span class="cline-any cline-yes">1x</span>
|
293
|
+
<span class="cline-any cline-yes">1x</span>
|
294
|
+
<span class="cline-any cline-neutral"> </span>
|
295
|
+
<span class="cline-any cline-yes">1x</span>
|
296
|
+
<span class="cline-any cline-yes">1x</span>
|
297
|
+
<span class="cline-any cline-neutral"> </span>
|
298
|
+
<span class="cline-any cline-yes">1x</span>
|
299
|
+
<span class="cline-any cline-yes">2x</span>
|
300
|
+
<span class="cline-any cline-neutral"> </span>
|
301
|
+
<span class="cline-any cline-neutral"> </span>
|
302
|
+
<span class="cline-any cline-neutral"> </span>
|
303
|
+
<span class="cline-any cline-neutral"> </span>
|
304
|
+
<span class="cline-any cline-yes">1x</span>
|
305
|
+
<span class="cline-any cline-neutral"> </span>
|
306
|
+
<span class="cline-any cline-neutral"> </span>
|
307
|
+
<span class="cline-any cline-neutral"> </span>
|
308
|
+
<span class="cline-any cline-yes">20x</span>
|
309
|
+
<span class="cline-any cline-neutral"> </span>
|
310
|
+
<span class="cline-any cline-yes">20x</span>
|
311
|
+
<span class="cline-any cline-yes">20x</span>
|
312
|
+
<span class="cline-any cline-neutral"> </span>
|
313
|
+
<span class="cline-any cline-neutral"> </span>
|
314
|
+
<span class="cline-any cline-neutral"> </span>
|
315
|
+
<span class="cline-any cline-yes">20x</span>
|
316
|
+
<span class="cline-any cline-neutral"> </span>
|
317
|
+
<span class="cline-any cline-neutral"> </span>
|
318
|
+
<span class="cline-any cline-neutral"> </span>
|
319
|
+
<span class="cline-any cline-yes">18x</span>
|
320
|
+
<span class="cline-any cline-neutral"> </span>
|
321
|
+
<span class="cline-any cline-neutral"> </span>
|
322
|
+
<span class="cline-any cline-neutral"> </span>
|
323
|
+
<span class="cline-any cline-yes">2x</span>
|
324
|
+
<span class="cline-any cline-neutral"> </span>
|
325
|
+
<span class="cline-any cline-neutral"> </span>
|
326
|
+
<span class="cline-any cline-neutral"> </span>
|
327
|
+
<span class="cline-any cline-yes">1x</span>
|
328
|
+
<span class="cline-any cline-yes">1x</span>
|
329
|
+
<span class="cline-any cline-neutral"> </span>
|
330
|
+
<span class="cline-any cline-yes">1x</span>
|
331
|
+
<span class="cline-any cline-yes">1x</span>
|
332
|
+
<span class="cline-any cline-yes">1x</span>
|
333
|
+
<span class="cline-any cline-yes">1x</span>
|
334
|
+
<span class="cline-any cline-neutral"> </span>
|
335
|
+
<span class="cline-any cline-neutral"> </span>
|
336
|
+
<span class="cline-any cline-yes">1x</span>
|
337
|
+
<span class="cline-any cline-no"> </span>
|
338
|
+
<span class="cline-any cline-no"> </span>
|
339
|
+
<span class="cline-any cline-neutral"> </span>
|
340
|
+
<span class="cline-any cline-neutral"> </span>
|
341
|
+
<span class="cline-any cline-yes">1x</span>
|
342
|
+
<span class="cline-any cline-neutral"> </span>
|
343
|
+
<span class="cline-any cline-yes">1x</span>
|
344
|
+
<span class="cline-any cline-neutral"> </span>
|
345
|
+
<span class="cline-any cline-yes">1x</span>
|
346
|
+
<span class="cline-any cline-neutral"> </span>
|
347
|
+
<span class="cline-any cline-neutral"> </span>
|
348
|
+
<span class="cline-any cline-neutral"> </span>
|
349
|
+
<span class="cline-any cline-yes">1x</span>
|
350
|
+
<span class="cline-any cline-neutral"> </span>
|
351
|
+
<span class="cline-any cline-neutral"> </span>
|
352
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">'use strict';
|
353
|
+
|
354
|
+
const
|
355
|
+
Q = require('q'),
|
356
|
+
|
357
|
+
CoaParam = require('./coaparam'),
|
358
|
+
Color = require('./color');
|
359
|
+
|
360
|
+
/**
|
361
|
+
* Option
|
362
|
+
*
|
363
|
+
* Named entity. Options may have short and long keys for use from command line.
|
364
|
+
*
|
365
|
+
* @namespace
|
366
|
+
* @class Opt
|
367
|
+
* @extends CoaParam
|
368
|
+
*/
|
369
|
+
module.exports = class Opt extends CoaParam {
|
370
|
+
/**
|
371
|
+
* @constructs
|
372
|
+
* @param {COA.Cmd} cmd - parent command
|
373
|
+
*/
|
374
|
+
constructor(cmd) {
|
375
|
+
super(cmd);
|
376
|
+
|
377
|
+
this._short = null;
|
378
|
+
this._long = null;
|
379
|
+
this._flag = false;
|
380
|
+
this._only = false;
|
381
|
+
this._cmd._opts.push(this);
|
382
|
+
}
|
383
|
+
|
384
|
+
/**
|
385
|
+
* Set a short key for option to be used with one hyphen from command line.
|
386
|
+
*
|
387
|
+
* @param {String} short - short name
|
388
|
+
* @returns {COA.Opt} - this instance (for chainability)
|
389
|
+
*/
|
390
|
+
short(short) {
|
391
|
+
this._short = short;
|
392
|
+
this._cmd._optsByKey[`-${short}`] = this;
|
393
|
+
return this;
|
394
|
+
}
|
395
|
+
|
396
|
+
/**
|
397
|
+
* Set a short key for option to be used with double hyphens from command line.
|
398
|
+
*
|
399
|
+
* @param {String} long - long name
|
400
|
+
* @returns {COA.Opt} - this instance (for chainability)
|
401
|
+
*/
|
402
|
+
long(long) {
|
403
|
+
this._long = long;
|
404
|
+
this._cmd._optsByKey[`--${long}`] = this;
|
405
|
+
return this;
|
406
|
+
}
|
407
|
+
|
408
|
+
/**
|
409
|
+
* Make an option boolean, i.e. option without value.
|
410
|
+
*
|
411
|
+
* @returns {COA.Opt} - this instance (for chainability)
|
412
|
+
*/
|
413
|
+
flag() {
|
414
|
+
this._flag = true;
|
415
|
+
return this;
|
416
|
+
}
|
417
|
+
|
418
|
+
/**
|
419
|
+
* Makes an option to act as a command,
|
420
|
+
* i.e. program will exit just after option action.
|
421
|
+
*
|
422
|
+
* @returns {COA.Opt} - this instance (for chainability)
|
423
|
+
*/
|
424
|
+
only() {
|
425
|
+
this._only = true;
|
426
|
+
return this;
|
427
|
+
}
|
428
|
+
|
429
|
+
/**
|
430
|
+
* Add action for current option command.
|
431
|
+
* This action is performed if the current option
|
432
|
+
* is present in parsed options (with any value).
|
433
|
+
*
|
434
|
+
* @param {Function} act - action function,
|
435
|
+
* invoked in the context of command instance
|
436
|
+
* and has the parameters:
|
437
|
+
* - {Object} opts - parsed options
|
438
|
+
* - {Array} args - parsed arguments
|
439
|
+
* - {Object} res - actions result accumulator
|
440
|
+
* It can return rejected promise by Cmd.reject (in case of error)
|
441
|
+
* or any other value treated as result.
|
442
|
+
* @returns {COA.Opt} - this instance (for chainability)
|
443
|
+
*/
|
444
|
+
act(act) {
|
445
|
+
this._cmd.act((opts) => {
|
446
|
+
<span class="missing-if-branch" title="if path not taken" >I</span>if(!opts.hasOwnProperty(this._name)) <span class="cstat-no" title="statement not covered" >return;</span>
|
447
|
+
|
448
|
+
const res = act.apply(this._cmd, arguments);
|
449
|
+
<span class="missing-if-branch" title="if path not taken" >I</span>if(!this._only) <span class="cstat-no" title="statement not covered" >return res;</span>
|
450
|
+
|
451
|
+
return Q.when(res, (out) => this._cmd.reject({
|
452
|
+
toString : () => out.toString(),
|
453
|
+
exitCode : 0
|
454
|
+
}));
|
455
|
+
});
|
456
|
+
|
457
|
+
return this;
|
458
|
+
}
|
459
|
+
|
460
|
+
_saveVal(opts, val) {
|
461
|
+
this._val && (val = this._val(val));
|
462
|
+
|
463
|
+
const name = this._name;
|
464
|
+
this._arr
|
465
|
+
? (opts[name] || (opts[name] = [])).push(val)
|
466
|
+
: (opts[name] = val);
|
467
|
+
|
468
|
+
return val;
|
469
|
+
}
|
470
|
+
|
471
|
+
_parse(argv, opts) {
|
472
|
+
return this._saveVal(opts, this._flag ? true : argv.shift());
|
473
|
+
}
|
474
|
+
|
475
|
+
_checkParsed(opts) {
|
476
|
+
return !opts.hasOwnProperty(this._name);
|
477
|
+
}
|
478
|
+
|
479
|
+
_usage() {
|
480
|
+
const res = [],
|
481
|
+
nameStr = this._name.toUpperCase();
|
482
|
+
|
483
|
+
<span class="missing-if-branch" title="else path not taken" >E</span>if(this._short) {
|
484
|
+
res.push('-', Color('lgreen', this._short));
|
485
|
+
this._flag || res.push(' ' + nameStr);
|
486
|
+
res.push(', ');
|
487
|
+
}
|
488
|
+
|
489
|
+
<span class="missing-if-branch" title="if path not taken" >I</span>if(this._long) {
|
490
|
+
<span class="cstat-no" title="statement not covered" > res.push('--', Color('green', this._long));</span>
|
491
|
+
<span class="cstat-no" title="statement not covered" > this._flag || res.push('=' + nameStr);</span>
|
492
|
+
}
|
493
|
+
|
494
|
+
res.push(' : ', this._title);
|
495
|
+
|
496
|
+
this._req && res.push(' ', Color('lred', '(required)'));
|
497
|
+
|
498
|
+
return res.join('');
|
499
|
+
}
|
500
|
+
|
501
|
+
_requiredText() {
|
502
|
+
return `Missing required option:\n ${this._usage()}`;
|
503
|
+
}
|
504
|
+
};
|
505
|
+
</pre></td></tr>
|
506
|
+
</table></pre>
|
507
|
+
<div class='push'></div><!-- for sticky footer -->
|
508
|
+
</div><!-- /wrapper -->
|
509
|
+
<div class='footer quiet pad2 space-top1 center small'>
|
510
|
+
Code coverage
|
511
|
+
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Feb 17 2017 22:25:28 GMT+0300 (MSK)
|
512
|
+
</div>
|
513
|
+
</div>
|
514
|
+
<script src="../../prettify.js"></script>
|
515
|
+
<script>
|
516
|
+
window.onload = function () {
|
517
|
+
if (typeof prettyPrint === 'function') {
|
518
|
+
prettyPrint();
|
519
|
+
}
|
520
|
+
};
|
521
|
+
</script>
|
522
|
+
<script src="../../sorter.js"></script>
|
523
|
+
</body>
|
524
|
+
</html>
|
@@ -0,0 +1,107 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<title>Code coverage report for coa/lib/shell.js</title>
|
5
|
+
<meta charset="utf-8" />
|
6
|
+
<link rel="stylesheet" href="../../prettify.css" />
|
7
|
+
<link rel="stylesheet" href="../../base.css" />
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
9
|
+
<style type='text/css'>
|
10
|
+
.coverage-summary .sorter {
|
11
|
+
background-image: url(../../sort-arrow-sprite.png);
|
12
|
+
}
|
13
|
+
</style>
|
14
|
+
</head>
|
15
|
+
<body>
|
16
|
+
<div class='wrapper'>
|
17
|
+
<div class='pad1'>
|
18
|
+
<h1>
|
19
|
+
<a href="../../index.html">All files</a> / <a href="index.html">coa/lib</a> shell.js
|
20
|
+
</h1>
|
21
|
+
<div class='clearfix'>
|
22
|
+
<div class='fl pad1y space-right2'>
|
23
|
+
<span class="strong">100% </span>
|
24
|
+
<span class="quiet">Statements</span>
|
25
|
+
<span class='fraction'>5/5</span>
|
26
|
+
</div>
|
27
|
+
<div class='fl pad1y space-right2'>
|
28
|
+
<span class="strong">100% </span>
|
29
|
+
<span class="quiet">Branches</span>
|
30
|
+
<span class='fraction'>4/4</span>
|
31
|
+
</div>
|
32
|
+
<div class='fl pad1y space-right2'>
|
33
|
+
<span class="strong">100% </span>
|
34
|
+
<span class="quiet">Functions</span>
|
35
|
+
<span class='fraction'>2/2</span>
|
36
|
+
</div>
|
37
|
+
<div class='fl pad1y space-right2'>
|
38
|
+
<span class="strong">100% </span>
|
39
|
+
<span class="quiet">Lines</span>
|
40
|
+
<span class='fraction'>5/5</span>
|
41
|
+
</div>
|
42
|
+
</div>
|
43
|
+
</div>
|
44
|
+
<div class='status-line high'></div>
|
45
|
+
<pre><table class="coverage">
|
46
|
+
<tr><td class="line-count quiet">1
|
47
|
+
2
|
48
|
+
3
|
49
|
+
4
|
50
|
+
5
|
51
|
+
6
|
52
|
+
7
|
53
|
+
8
|
54
|
+
9
|
55
|
+
10
|
56
|
+
11
|
57
|
+
12
|
58
|
+
13
|
59
|
+
14
|
60
|
+
15</td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
|
61
|
+
<span class="cline-any cline-neutral"> </span>
|
62
|
+
<span class="cline-any cline-neutral"> </span>
|
63
|
+
<span class="cline-any cline-yes">2x</span>
|
64
|
+
<span class="cline-any cline-neutral"> </span>
|
65
|
+
<span class="cline-any cline-neutral"> </span>
|
66
|
+
<span class="cline-any cline-neutral"> </span>
|
67
|
+
<span class="cline-any cline-yes">2x</span>
|
68
|
+
<span class="cline-any cline-neutral"> </span>
|
69
|
+
<span class="cline-any cline-neutral"> </span>
|
70
|
+
<span class="cline-any cline-neutral"> </span>
|
71
|
+
<span class="cline-any cline-yes">6x</span>
|
72
|
+
<span class="cline-any cline-yes">6x</span>
|
73
|
+
<span class="cline-any cline-neutral"> </span>
|
74
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">module.exports = { escape, unescape };
|
75
|
+
|
76
|
+
function unescape(w) {
|
77
|
+
w = w.charAt(0) === '"'
|
78
|
+
? w.replace(/^"|([^\\])"$/g, '$1')
|
79
|
+
: w.replace(/\\ /g, ' ');
|
80
|
+
|
81
|
+
return w.replace(/\\("|'|\$|`|\\)/g, '$1');
|
82
|
+
}
|
83
|
+
|
84
|
+
function escape(w) {
|
85
|
+
w = w.replace(/(["'$`\\])/g,'\\$1');
|
86
|
+
return w.match(/\s+/) ? `"${w}"` : w;
|
87
|
+
}
|
88
|
+
</pre></td></tr>
|
89
|
+
</table></pre>
|
90
|
+
<div class='push'></div><!-- for sticky footer -->
|
91
|
+
</div><!-- /wrapper -->
|
92
|
+
<div class='footer quiet pad2 space-top1 center small'>
|
93
|
+
Code coverage
|
94
|
+
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Feb 17 2017 22:25:28 GMT+0300 (MSK)
|
95
|
+
</div>
|
96
|
+
</div>
|
97
|
+
<script src="../../prettify.js"></script>
|
98
|
+
<script>
|
99
|
+
window.onload = function () {
|
100
|
+
if (typeof prettyPrint === 'function') {
|
101
|
+
prettyPrint();
|
102
|
+
}
|
103
|
+
};
|
104
|
+
</script>
|
105
|
+
<script src="../../sorter.js"></script>
|
106
|
+
</body>
|
107
|
+
</html>
|