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,212 @@
|
|
1
|
+
body, html {
|
2
|
+
margin:0; padding: 0;
|
3
|
+
height: 100%;
|
4
|
+
}
|
5
|
+
body {
|
6
|
+
font-family: Helvetica Neue, Helvetica, Arial;
|
7
|
+
font-size: 14px;
|
8
|
+
color:#333;
|
9
|
+
}
|
10
|
+
.small { font-size: 12px; }
|
11
|
+
*, *:after, *:before {
|
12
|
+
-webkit-box-sizing:border-box;
|
13
|
+
-moz-box-sizing:border-box;
|
14
|
+
box-sizing:border-box;
|
15
|
+
}
|
16
|
+
h1 { font-size: 20px; margin: 0;}
|
17
|
+
h2 { font-size: 14px; }
|
18
|
+
pre {
|
19
|
+
font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
20
|
+
margin: 0;
|
21
|
+
padding: 0;
|
22
|
+
-moz-tab-size: 2;
|
23
|
+
-o-tab-size: 2;
|
24
|
+
tab-size: 2;
|
25
|
+
}
|
26
|
+
a { color:#0074D9; text-decoration:none; }
|
27
|
+
a:hover { text-decoration:underline; }
|
28
|
+
.strong { font-weight: bold; }
|
29
|
+
.space-top1 { padding: 10px 0 0 0; }
|
30
|
+
.pad2y { padding: 20px 0; }
|
31
|
+
.pad1y { padding: 10px 0; }
|
32
|
+
.pad2x { padding: 0 20px; }
|
33
|
+
.pad2 { padding: 20px; }
|
34
|
+
.pad1 { padding: 10px; }
|
35
|
+
.space-left2 { padding-left:55px; }
|
36
|
+
.space-right2 { padding-right:20px; }
|
37
|
+
.center { text-align:center; }
|
38
|
+
.clearfix { display:block; }
|
39
|
+
.clearfix:after {
|
40
|
+
content:'';
|
41
|
+
display:block;
|
42
|
+
height:0;
|
43
|
+
clear:both;
|
44
|
+
visibility:hidden;
|
45
|
+
}
|
46
|
+
.fl { float: left; }
|
47
|
+
@media only screen and (max-width:640px) {
|
48
|
+
.col3 { width:100%; max-width:100%; }
|
49
|
+
.hide-mobile { display:none!important; }
|
50
|
+
}
|
51
|
+
|
52
|
+
.quiet {
|
53
|
+
color: #7f7f7f;
|
54
|
+
color: rgba(0,0,0,0.5);
|
55
|
+
}
|
56
|
+
.quiet a { opacity: 0.7; }
|
57
|
+
|
58
|
+
.fraction {
|
59
|
+
font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
|
60
|
+
font-size: 10px;
|
61
|
+
color: #555;
|
62
|
+
background: #E8E8E8;
|
63
|
+
padding: 4px 5px;
|
64
|
+
border-radius: 3px;
|
65
|
+
vertical-align: middle;
|
66
|
+
}
|
67
|
+
|
68
|
+
div.path a:link, div.path a:visited { color: #333; }
|
69
|
+
table.coverage {
|
70
|
+
border-collapse: collapse;
|
71
|
+
margin: 10px 0 0 0;
|
72
|
+
padding: 0;
|
73
|
+
}
|
74
|
+
|
75
|
+
table.coverage td {
|
76
|
+
margin: 0;
|
77
|
+
padding: 0;
|
78
|
+
vertical-align: top;
|
79
|
+
}
|
80
|
+
table.coverage td.line-count {
|
81
|
+
text-align: right;
|
82
|
+
padding: 0 5px 0 20px;
|
83
|
+
}
|
84
|
+
table.coverage td.line-coverage {
|
85
|
+
text-align: right;
|
86
|
+
padding-right: 10px;
|
87
|
+
min-width:20px;
|
88
|
+
}
|
89
|
+
|
90
|
+
table.coverage td span.cline-any {
|
91
|
+
display: inline-block;
|
92
|
+
padding: 0 5px;
|
93
|
+
width: 100%;
|
94
|
+
}
|
95
|
+
.missing-if-branch {
|
96
|
+
display: inline-block;
|
97
|
+
margin-right: 5px;
|
98
|
+
border-radius: 3px;
|
99
|
+
position: relative;
|
100
|
+
padding: 0 4px;
|
101
|
+
background: #333;
|
102
|
+
color: yellow;
|
103
|
+
}
|
104
|
+
|
105
|
+
.skip-if-branch {
|
106
|
+
display: none;
|
107
|
+
margin-right: 10px;
|
108
|
+
position: relative;
|
109
|
+
padding: 0 4px;
|
110
|
+
background: #ccc;
|
111
|
+
color: white;
|
112
|
+
}
|
113
|
+
.missing-if-branch .typ, .skip-if-branch .typ {
|
114
|
+
color: inherit !important;
|
115
|
+
}
|
116
|
+
.coverage-summary {
|
117
|
+
border-collapse: collapse;
|
118
|
+
width: 100%;
|
119
|
+
}
|
120
|
+
.coverage-summary tr { border-bottom: 1px solid #bbb; }
|
121
|
+
.keyline-all { border: 1px solid #ddd; }
|
122
|
+
.coverage-summary td, .coverage-summary th { padding: 10px; }
|
123
|
+
.coverage-summary tbody { border: 1px solid #bbb; }
|
124
|
+
.coverage-summary td { border-right: 1px solid #bbb; }
|
125
|
+
.coverage-summary td:last-child { border-right: none; }
|
126
|
+
.coverage-summary th {
|
127
|
+
text-align: left;
|
128
|
+
font-weight: normal;
|
129
|
+
white-space: nowrap;
|
130
|
+
}
|
131
|
+
.coverage-summary th.file { border-right: none !important; }
|
132
|
+
.coverage-summary th.pct { }
|
133
|
+
.coverage-summary th.pic,
|
134
|
+
.coverage-summary th.abs,
|
135
|
+
.coverage-summary td.pct,
|
136
|
+
.coverage-summary td.abs { text-align: right; }
|
137
|
+
.coverage-summary td.file { white-space: nowrap; }
|
138
|
+
.coverage-summary td.pic { min-width: 120px !important; }
|
139
|
+
.coverage-summary tfoot td { }
|
140
|
+
|
141
|
+
.coverage-summary .sorter {
|
142
|
+
height: 10px;
|
143
|
+
width: 7px;
|
144
|
+
display: inline-block;
|
145
|
+
margin-left: 0.5em;
|
146
|
+
background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent;
|
147
|
+
}
|
148
|
+
.coverage-summary .sorted .sorter {
|
149
|
+
background-position: 0 -20px;
|
150
|
+
}
|
151
|
+
.coverage-summary .sorted-desc .sorter {
|
152
|
+
background-position: 0 -10px;
|
153
|
+
}
|
154
|
+
.status-line { height: 10px; }
|
155
|
+
/* dark red */
|
156
|
+
.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 }
|
157
|
+
.low .chart { border:1px solid #C21F39 }
|
158
|
+
/* medium red */
|
159
|
+
.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE }
|
160
|
+
/* light red */
|
161
|
+
.low, .cline-no { background:#FCE1E5 }
|
162
|
+
/* light green */
|
163
|
+
.high, .cline-yes { background:rgb(230,245,208) }
|
164
|
+
/* medium green */
|
165
|
+
.cstat-yes { background:rgb(161,215,106) }
|
166
|
+
/* dark green */
|
167
|
+
.status-line.high, .high .cover-fill { background:rgb(77,146,33) }
|
168
|
+
.high .chart { border:1px solid rgb(77,146,33) }
|
169
|
+
|
170
|
+
|
171
|
+
.medium .chart { border:1px solid #666; }
|
172
|
+
.medium .cover-fill { background: #666; }
|
173
|
+
|
174
|
+
.cbranch-no { background: yellow !important; color: #111; }
|
175
|
+
|
176
|
+
.cstat-skip { background: #ddd; color: #111; }
|
177
|
+
.fstat-skip { background: #ddd; color: #111 !important; }
|
178
|
+
.cbranch-skip { background: #ddd !important; color: #111; }
|
179
|
+
|
180
|
+
span.cline-neutral { background: #eaeaea; }
|
181
|
+
.medium { background: #eaeaea; }
|
182
|
+
|
183
|
+
.cover-fill, .cover-empty {
|
184
|
+
display:inline-block;
|
185
|
+
height: 12px;
|
186
|
+
}
|
187
|
+
.chart {
|
188
|
+
line-height: 0;
|
189
|
+
}
|
190
|
+
.cover-empty {
|
191
|
+
background: white;
|
192
|
+
}
|
193
|
+
.cover-full {
|
194
|
+
border-right: none !important;
|
195
|
+
}
|
196
|
+
pre.prettyprint {
|
197
|
+
border: none !important;
|
198
|
+
padding: 0 !important;
|
199
|
+
margin: 0 !important;
|
200
|
+
}
|
201
|
+
.com { color: #999 !important; }
|
202
|
+
.ignore-none { color: #999; font-weight: normal; }
|
203
|
+
|
204
|
+
.wrapper {
|
205
|
+
min-height: 100%;
|
206
|
+
height: auto !important;
|
207
|
+
height: 100%;
|
208
|
+
margin: 0 auto -48px;
|
209
|
+
}
|
210
|
+
.footer, .push {
|
211
|
+
height: 48px;
|
212
|
+
}
|
@@ -0,0 +1,93 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<title>Code coverage report for coa</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> coa
|
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'>1/1</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'>0/0</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'>0/0</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'>1/1</span>
|
41
|
+
</div>
|
42
|
+
</div>
|
43
|
+
</div>
|
44
|
+
<div class='status-line high'></div>
|
45
|
+
<div class="pad1">
|
46
|
+
<table class="coverage-summary">
|
47
|
+
<thead>
|
48
|
+
<tr>
|
49
|
+
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
|
50
|
+
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
|
51
|
+
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
|
52
|
+
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
|
53
|
+
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
|
54
|
+
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
|
55
|
+
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
|
56
|
+
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
|
57
|
+
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
|
58
|
+
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
|
59
|
+
</tr>
|
60
|
+
</thead>
|
61
|
+
<tbody><tr>
|
62
|
+
<td class="file high" data-value="index.js"><a href="index.js.html">index.js</a></td>
|
63
|
+
<td data-value="100" class="pic high"><div class="chart"><div class="cover-fill cover-full" style="width: 100%;"></div><div class="cover-empty" style="width:0%;"></div></div></td>
|
64
|
+
<td data-value="100" class="pct high">100%</td>
|
65
|
+
<td data-value="1" class="abs high">1/1</td>
|
66
|
+
<td data-value="100" class="pct high">100%</td>
|
67
|
+
<td data-value="0" class="abs high">0/0</td>
|
68
|
+
<td data-value="100" class="pct high">100%</td>
|
69
|
+
<td data-value="0" class="abs high">0/0</td>
|
70
|
+
<td data-value="100" class="pct high">100%</td>
|
71
|
+
<td data-value="1" class="abs high">1/1</td>
|
72
|
+
</tr>
|
73
|
+
|
74
|
+
</tbody>
|
75
|
+
</table>
|
76
|
+
</div><div class='push'></div><!-- for sticky footer -->
|
77
|
+
</div><!-- /wrapper -->
|
78
|
+
<div class='footer quiet pad2 space-top1 center small'>
|
79
|
+
Code coverage
|
80
|
+
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Feb 17 2017 22:25:28 GMT+0300 (MSK)
|
81
|
+
</div>
|
82
|
+
</div>
|
83
|
+
<script src="../prettify.js"></script>
|
84
|
+
<script>
|
85
|
+
window.onload = function () {
|
86
|
+
if (typeof prettyPrint === 'function') {
|
87
|
+
prettyPrint();
|
88
|
+
}
|
89
|
+
};
|
90
|
+
</script>
|
91
|
+
<script src="../sorter.js"></script>
|
92
|
+
</body>
|
93
|
+
</html>
|
@@ -0,0 +1,68 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<title>Code coverage report for coa/index.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</a> index.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'>1/1</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'>0/0</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'>0/0</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'>1/1</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</td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
|
48
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">module.exports = require('./lib');
|
49
|
+
</pre></td></tr>
|
50
|
+
</table></pre>
|
51
|
+
<div class='push'></div><!-- for sticky footer -->
|
52
|
+
</div><!-- /wrapper -->
|
53
|
+
<div class='footer quiet pad2 space-top1 center small'>
|
54
|
+
Code coverage
|
55
|
+
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Feb 17 2017 22:25:28 GMT+0300 (MSK)
|
56
|
+
</div>
|
57
|
+
</div>
|
58
|
+
<script src="../prettify.js"></script>
|
59
|
+
<script>
|
60
|
+
window.onload = function () {
|
61
|
+
if (typeof prettyPrint === 'function') {
|
62
|
+
prettyPrint();
|
63
|
+
}
|
64
|
+
};
|
65
|
+
</script>
|
66
|
+
<script src="../sorter.js"></script>
|
67
|
+
</body>
|
68
|
+
</html>
|
@@ -0,0 +1,239 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<title>Code coverage report for coa/lib/arg.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> arg.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'>16/16</span>
|
26
|
+
</div>
|
27
|
+
<div class='fl pad1y space-right2'>
|
28
|
+
<span class="strong">87.5% </span>
|
29
|
+
<span class="quiet">Branches</span>
|
30
|
+
<span class='fraction'>7/8</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'>6/6</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'>16/16</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</td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
105
|
+
<span class="cline-any cline-neutral"> </span>
|
106
|
+
<span class="cline-any cline-neutral"> </span>
|
107
|
+
<span class="cline-any cline-yes">1x</span>
|
108
|
+
<span class="cline-any cline-yes">1x</span>
|
109
|
+
<span class="cline-any cline-neutral"> </span>
|
110
|
+
<span class="cline-any cline-neutral"> </span>
|
111
|
+
<span class="cline-any cline-neutral"> </span>
|
112
|
+
<span class="cline-any cline-neutral"> </span>
|
113
|
+
<span class="cline-any cline-neutral"> </span>
|
114
|
+
<span class="cline-any cline-neutral"> </span>
|
115
|
+
<span class="cline-any cline-neutral"> </span>
|
116
|
+
<span class="cline-any cline-neutral"> </span>
|
117
|
+
<span class="cline-any cline-neutral"> </span>
|
118
|
+
<span class="cline-any cline-yes">1x</span>
|
119
|
+
<span class="cline-any cline-neutral"> </span>
|
120
|
+
<span class="cline-any cline-neutral"> </span>
|
121
|
+
<span class="cline-any cline-neutral"> </span>
|
122
|
+
<span class="cline-any cline-neutral"> </span>
|
123
|
+
<span class="cline-any cline-neutral"> </span>
|
124
|
+
<span class="cline-any cline-yes">16x</span>
|
125
|
+
<span class="cline-any cline-neutral"> </span>
|
126
|
+
<span class="cline-any cline-yes">16x</span>
|
127
|
+
<span class="cline-any cline-neutral"> </span>
|
128
|
+
<span class="cline-any cline-neutral"> </span>
|
129
|
+
<span class="cline-any cline-neutral"> </span>
|
130
|
+
<span class="cline-any cline-yes">31x</span>
|
131
|
+
<span class="cline-any cline-neutral"> </span>
|
132
|
+
<span class="cline-any cline-yes">31x</span>
|
133
|
+
<span class="cline-any cline-yes">31x</span>
|
134
|
+
<span class="cline-any cline-neutral"> </span>
|
135
|
+
<span class="cline-any cline-neutral"> </span>
|
136
|
+
<span class="cline-any cline-neutral"> </span>
|
137
|
+
<span class="cline-any cline-yes">31x</span>
|
138
|
+
<span class="cline-any cline-neutral"> </span>
|
139
|
+
<span class="cline-any cline-neutral"> </span>
|
140
|
+
<span class="cline-any cline-neutral"> </span>
|
141
|
+
<span class="cline-any cline-yes">28x</span>
|
142
|
+
<span class="cline-any cline-neutral"> </span>
|
143
|
+
<span class="cline-any cline-neutral"> </span>
|
144
|
+
<span class="cline-any cline-neutral"> </span>
|
145
|
+
<span class="cline-any cline-yes">2x</span>
|
146
|
+
<span class="cline-any cline-neutral"> </span>
|
147
|
+
<span class="cline-any cline-neutral"> </span>
|
148
|
+
<span class="cline-any cline-neutral"> </span>
|
149
|
+
<span class="cline-any cline-yes">1x</span>
|
150
|
+
<span class="cline-any cline-neutral"> </span>
|
151
|
+
<span class="cline-any cline-yes">1x</span>
|
152
|
+
<span class="cline-any cline-neutral"> </span>
|
153
|
+
<span class="cline-any cline-yes">1x</span>
|
154
|
+
<span class="cline-any cline-neutral"> </span>
|
155
|
+
<span class="cline-any cline-yes">1x</span>
|
156
|
+
<span class="cline-any cline-neutral"> </span>
|
157
|
+
<span class="cline-any cline-neutral"> </span>
|
158
|
+
<span class="cline-any cline-neutral"> </span>
|
159
|
+
<span class="cline-any cline-yes">1x</span>
|
160
|
+
<span class="cline-any cline-neutral"> </span>
|
161
|
+
<span class="cline-any cline-neutral"> </span>
|
162
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">'use strict';
|
163
|
+
|
164
|
+
const
|
165
|
+
CoaParam = require('./coaparam'),
|
166
|
+
Color = require('./color');
|
167
|
+
|
168
|
+
/**
|
169
|
+
* Argument
|
170
|
+
*
|
171
|
+
* Unnamed entity. From command line arguments passed as list of unnamed values.
|
172
|
+
*
|
173
|
+
* @class Arg
|
174
|
+
* @extends CoaParam
|
175
|
+
*/
|
176
|
+
module.exports = class Arg extends CoaParam {
|
177
|
+
/**
|
178
|
+
* @constructs
|
179
|
+
* @param {COA.Cmd} cmd - parent command
|
180
|
+
*/
|
181
|
+
constructor(cmd) {
|
182
|
+
super(cmd);
|
183
|
+
|
184
|
+
this._cmd._args.push(this);
|
185
|
+
}
|
186
|
+
|
187
|
+
_saveVal(args, val) {
|
188
|
+
this._val && (<span class="branch-1 cbranch-no" title="branch not covered" >val = this._val(val))</span>;
|
189
|
+
|
190
|
+
const name = this._name;
|
191
|
+
this._arr
|
192
|
+
? (args[name] || (args[name] = [])).push(val)
|
193
|
+
: (args[name] = val);
|
194
|
+
|
195
|
+
return val;
|
196
|
+
}
|
197
|
+
|
198
|
+
_parse(arg, args) {
|
199
|
+
return this._saveVal(args, arg);
|
200
|
+
}
|
201
|
+
|
202
|
+
_checkParsed(opts, args) {
|
203
|
+
return !args.hasOwnProperty(this._name);
|
204
|
+
}
|
205
|
+
|
206
|
+
_usage() {
|
207
|
+
const res = [];
|
208
|
+
|
209
|
+
res.push(Color('lpurple', this._name.toUpperCase()), ' : ', this._title);
|
210
|
+
|
211
|
+
this._req && res.push(' ', Color('lred', '(required)'));
|
212
|
+
|
213
|
+
return res.join('');
|
214
|
+
}
|
215
|
+
|
216
|
+
_requiredText() {
|
217
|
+
return `Missing required argument:\n ${this._usage()}`;
|
218
|
+
}
|
219
|
+
};
|
220
|
+
</pre></td></tr>
|
221
|
+
</table></pre>
|
222
|
+
<div class='push'></div><!-- for sticky footer -->
|
223
|
+
</div><!-- /wrapper -->
|
224
|
+
<div class='footer quiet pad2 space-top1 center small'>
|
225
|
+
Code coverage
|
226
|
+
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Feb 17 2017 22:25:28 GMT+0300 (MSK)
|
227
|
+
</div>
|
228
|
+
</div>
|
229
|
+
<script src="../../prettify.js"></script>
|
230
|
+
<script>
|
231
|
+
window.onload = function () {
|
232
|
+
if (typeof prettyPrint === 'function') {
|
233
|
+
prettyPrint();
|
234
|
+
}
|
235
|
+
};
|
236
|
+
</script>
|
237
|
+
<script src="../../sorter.js"></script>
|
238
|
+
</body>
|
239
|
+
</html>
|