ot-builder-cli 1.7.3 → 1.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/argv-parser/index.js +9 -7
- package/lib/create-grammar.d.ts +1 -1
- package/lib/create-grammar.js +5 -4
- package/lib/index.js +2 -3
- package/lib/package-version.d.ts +1 -1
- package/lib/package-version.js +8 -5
- package/lib/sub-parsers/unicode-ranges/generated.js +81 -79
- package/lib/syntax/actions/intro.js +2 -2
- package/lib/syntax/actions/merge.js +1 -1
- package/lib/syntax/actions/save.js +2 -2
- package/lib/syntax/composite/start.d.ts +2 -1
- package/lib/syntax/composite/start.js +3 -3
- package/lib/syntax/document/version.js +1 -1
- package/package.json +7 -8
package/lib/argv-parser/index.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
3
|
+
exports.ParseResult = ParseResult;
|
|
4
|
+
exports.StartParseArgv = StartParseArgv;
|
|
5
|
+
const cli_help_shower_1 = require("@ot-builder/cli-help-shower");
|
|
5
6
|
function ParseResult(progress, result) {
|
|
6
7
|
return { progress, result };
|
|
7
8
|
}
|
|
8
|
-
exports.ParseResult = ParseResult;
|
|
9
9
|
function StartParseArgv(argv, index = 0) {
|
|
10
10
|
return new ParseArgvImpl(argv, index);
|
|
11
11
|
}
|
|
12
|
-
exports.StartParseArgv = StartParseArgv;
|
|
13
12
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
14
13
|
class ParseArgvImpl {
|
|
15
14
|
constructor(argv, cp) {
|
|
@@ -25,7 +24,10 @@ class ParseArgvImpl {
|
|
|
25
24
|
return this.eof;
|
|
26
25
|
}
|
|
27
26
|
isOption(...options) {
|
|
28
|
-
|
|
27
|
+
return this.isOptionImpl(...options);
|
|
28
|
+
}
|
|
29
|
+
isOptionImpl(...options) {
|
|
30
|
+
if (this.eof)
|
|
29
31
|
return false;
|
|
30
32
|
const opt = this.argv[this.cp];
|
|
31
33
|
if (opt[0] !== "-" && opt[0] !== "+")
|
|
@@ -44,7 +46,7 @@ class ParseArgvImpl {
|
|
|
44
46
|
return this.option;
|
|
45
47
|
}
|
|
46
48
|
isArgument() {
|
|
47
|
-
return !this.
|
|
49
|
+
return !this.eof && !this.isOptionImpl();
|
|
48
50
|
}
|
|
49
51
|
expectArgument() {
|
|
50
52
|
if (!this.isArgument())
|
|
@@ -69,7 +71,7 @@ class ParseArgvImpl {
|
|
|
69
71
|
s += " ";
|
|
70
72
|
const segmentText = cp === 0 ? "node" : cp === 1 ? "otb-cli" : this.argv[cp];
|
|
71
73
|
if (cp === this.cp)
|
|
72
|
-
s +=
|
|
74
|
+
s += cli_help_shower_1.Style.ArgvParseError(segmentText);
|
|
73
75
|
else
|
|
74
76
|
s += segmentText;
|
|
75
77
|
}
|
package/lib/create-grammar.d.ts
CHANGED
package/lib/create-grammar.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createGrammar =
|
|
3
|
+
exports.createGrammar = createGrammar;
|
|
4
|
+
const package_version_1 = require("./package-version");
|
|
4
5
|
const consolidate_1 = require("./syntax/actions/consolidate");
|
|
5
6
|
const drop_1 = require("./syntax/actions/drop");
|
|
6
7
|
const gc_1 = require("./syntax/actions/gc");
|
|
@@ -28,7 +29,7 @@ const cliActionJoiner = {
|
|
|
28
29
|
}
|
|
29
30
|
};
|
|
30
31
|
// Grammar Creator
|
|
31
|
-
function createGrammar() {
|
|
32
|
+
async function createGrammar() {
|
|
32
33
|
const element = new alternate_1.AlternateSyntax([
|
|
33
34
|
intro_1.IntroSyntax,
|
|
34
35
|
save_1.SaveSyntax,
|
|
@@ -43,12 +44,12 @@ function createGrammar() {
|
|
|
43
44
|
set_optimize_level_1.SetOptimizationLevelSyntax,
|
|
44
45
|
set_recalc_os2_avg_char_width_1.SetRecalcOs2AvgCharWidthSyntax
|
|
45
46
|
]);
|
|
46
|
-
const
|
|
47
|
+
const appVersion = await (0, package_version_1.getPackageVersion)();
|
|
48
|
+
const start = new start_1.StartSyntax(appVersion, new alternate_1.AlternateSyntax([
|
|
47
49
|
help_1.HelpSyntax,
|
|
48
50
|
version_1.VersionSyntax,
|
|
49
51
|
new main_command_1.MainCommandSyntax(new possessive_repeat_1.PossessiveRepeatSyntax(cliActionJoiner, element))
|
|
50
52
|
]));
|
|
51
53
|
return { element, start };
|
|
52
54
|
}
|
|
53
|
-
exports.createGrammar = createGrammar;
|
|
54
55
|
//# sourceMappingURL=create-grammar.js.map
|
package/lib/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.cliMain =
|
|
3
|
+
exports.cliMain = cliMain;
|
|
4
4
|
const argv_parser_1 = require("./argv-parser");
|
|
5
5
|
const create_grammar_1 = require("./create-grammar");
|
|
6
6
|
const state_1 = require("./state");
|
|
7
7
|
async function cliMain(argv) {
|
|
8
8
|
const parse = (0, argv_parser_1.StartParseArgv)(argv, 2);
|
|
9
|
-
const syntax = (0, create_grammar_1.createGrammar)();
|
|
9
|
+
const syntax = await (0, create_grammar_1.createGrammar)();
|
|
10
10
|
const prAction = syntax.start.handle(parse, syntax);
|
|
11
11
|
if (!prAction.progress.isEof()) {
|
|
12
12
|
console.error("! Unrecognizable argument/option. Stop.");
|
|
@@ -18,5 +18,4 @@ async function cliMain(argv) {
|
|
|
18
18
|
await prAction.result(state);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
exports.cliMain = cliMain;
|
|
22
21
|
//# sourceMappingURL=index.js.map
|
package/lib/package-version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare
|
|
1
|
+
export declare function getPackageVersion(): Promise<string>;
|
|
2
2
|
//# sourceMappingURL=package-version.d.ts.map
|
package/lib/package-version.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
-
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
4
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.
|
|
6
|
-
const
|
|
7
|
-
|
|
3
|
+
exports.getPackageVersion = getPackageVersion;
|
|
4
|
+
const fs = require("fs");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
async function getPackageVersion() {
|
|
7
|
+
const moduleDir = path.join(__dirname, "..");
|
|
8
|
+
const json = JSON.parse(await fs.promises.readFile(path.join(moduleDir, "package.json"), "utf-8"));
|
|
9
|
+
return json.version;
|
|
10
|
+
}
|
|
8
11
|
//# sourceMappingURL=package-version.js.map
|
|
@@ -1,38 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* AutoGenerated Code, changes may be overwritten
|
|
3
|
-
* INPUT GRAMMAR:
|
|
4
|
-
* ---
|
|
5
|
-
* import { RangeDecl } from "./datatypes";
|
|
6
|
-
* ---
|
|
7
|
-
* start := __ rgs=Ranges __
|
|
8
|
-
* .ranges = RangeDecl[] { return this.rgs.ranges }
|
|
9
|
-
* Ranges := car=Range Separator cdr=Ranges
|
|
10
|
-
* .ranges = RangeDecl[] { return [this.car.codeRange, ...this.cdr.ranges] }
|
|
11
|
-
* | range=Range
|
|
12
|
-
* .ranges = RangeDecl[] { return [this.range.codeRange] }
|
|
13
|
-
* Range := _ exclude='-'? _ start=CodePoint _ '..' _ end=CodePoint _
|
|
14
|
-
* .codeRange = RangeDecl {
|
|
15
|
-
* return {
|
|
16
|
-
* isExclusion: !!this.exclude,
|
|
17
|
-
* start: this.start.value,
|
|
18
|
-
* end:this.end.value
|
|
19
|
-
* }
|
|
20
|
-
* }
|
|
21
|
-
* | _ exclude='-'? _ at=CodePoint _
|
|
22
|
-
* .codeRange = RangeDecl {
|
|
23
|
-
* return { isExclusion: !!this.exclude, start: this.at.value, end:this.at.value }
|
|
24
|
-
* }
|
|
25
|
-
* CodePoint := Prefix? literal='[0-9A-Fa-f]+'
|
|
26
|
-
* .value = number { return parseInt(this.literal, 16) }
|
|
27
|
-
* Prefix := 'U\+' | '0x' | '0X'
|
|
28
|
-
* Separator := _ '[,;]' __
|
|
29
|
-
* | ___
|
|
30
|
-
* _ := '[ \t]*'
|
|
31
|
-
* __ := '(?:[ \t]|(?:#[^\r\n]*)?[\r\n])*'
|
|
32
|
-
* ___ := _ '(?:#[^\r\n]*)?[\r\n]' __
|
|
33
|
-
*/
|
|
3
|
+
* INPUT GRAMMAR:
|
|
4
|
+
* ---
|
|
5
|
+
* import { RangeDecl } from "./datatypes";
|
|
6
|
+
* ---
|
|
7
|
+
* start := __ rgs=Ranges __
|
|
8
|
+
* .ranges = RangeDecl[] { return this.rgs.ranges }
|
|
9
|
+
* Ranges := car=Range Separator cdr=Ranges
|
|
10
|
+
* .ranges = RangeDecl[] { return [this.car.codeRange, ...this.cdr.ranges] }
|
|
11
|
+
* | range=Range
|
|
12
|
+
* .ranges = RangeDecl[] { return [this.range.codeRange] }
|
|
13
|
+
* Range := _ exclude='-'? _ start=CodePoint _ '..' _ end=CodePoint _
|
|
14
|
+
* .codeRange = RangeDecl {
|
|
15
|
+
* return {
|
|
16
|
+
* isExclusion: !!this.exclude,
|
|
17
|
+
* start: this.start.value,
|
|
18
|
+
* end:this.end.value
|
|
19
|
+
* }
|
|
20
|
+
* }
|
|
21
|
+
* | _ exclude='-'? _ at=CodePoint _
|
|
22
|
+
* .codeRange = RangeDecl {
|
|
23
|
+
* return { isExclusion: !!this.exclude, start: this.at.value, end:this.at.value }
|
|
24
|
+
* }
|
|
25
|
+
* CodePoint := Prefix? literal='[0-9A-Fa-f]+'
|
|
26
|
+
* .value = number { return parseInt(this.literal, 16) }
|
|
27
|
+
* Prefix := 'U\+' | '0x' | '0X'
|
|
28
|
+
* Separator := _ '[,;]' __
|
|
29
|
+
* | ___
|
|
30
|
+
* _ := '[ \t]*'
|
|
31
|
+
* __ := '(?:[ \t]|(?:#[^\r\n]*)?[\r\n])*'
|
|
32
|
+
* ___ := _ '(?:#[^\r\n]*)?[\r\n]' __
|
|
33
|
+
*/
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.SyntaxErr = exports.
|
|
35
|
+
exports.SyntaxErr = exports.Parser = exports.CodePoint = exports.Range_2 = exports.Range_1 = exports.Ranges_2 = exports.Ranges_1 = exports.start = exports.ASTKinds = void 0;
|
|
36
|
+
exports.parse = parse;
|
|
36
37
|
var ASTKinds;
|
|
37
38
|
(function (ASTKinds) {
|
|
38
39
|
ASTKinds[ASTKinds["start"] = 0] = "start";
|
|
@@ -156,10 +157,10 @@ class Parser {
|
|
|
156
157
|
return this.run($$dpth, () => {
|
|
157
158
|
let $scope$rgs;
|
|
158
159
|
let $$res = null;
|
|
159
|
-
if (true
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
160
|
+
if (true &&
|
|
161
|
+
this.match__($$dpth + 1, $$cr) !== null &&
|
|
162
|
+
($scope$rgs = this.matchRanges($$dpth + 1, $$cr)) !== null &&
|
|
163
|
+
this.match__($$dpth + 1, $$cr) !== null) {
|
|
163
164
|
$$res = new start($scope$rgs);
|
|
164
165
|
}
|
|
165
166
|
return $$res;
|
|
@@ -170,7 +171,7 @@ class Parser {
|
|
|
170
171
|
return this.memoise(() => {
|
|
171
172
|
return this.choice([
|
|
172
173
|
() => this.matchRanges_1($$dpth + 1, $$cr),
|
|
173
|
-
() => this.matchRanges_2($$dpth + 1, $$cr)
|
|
174
|
+
() => this.matchRanges_2($$dpth + 1, $$cr)
|
|
174
175
|
]);
|
|
175
176
|
}, this.$scope$Ranges$memo);
|
|
176
177
|
}
|
|
@@ -179,10 +180,10 @@ class Parser {
|
|
|
179
180
|
let $scope$car;
|
|
180
181
|
let $scope$cdr;
|
|
181
182
|
let $$res = null;
|
|
182
|
-
if (true
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
183
|
+
if (true &&
|
|
184
|
+
($scope$car = this.matchRange($$dpth + 1, $$cr)) !== null &&
|
|
185
|
+
this.matchSeparator($$dpth + 1, $$cr) !== null &&
|
|
186
|
+
($scope$cdr = this.matchRanges($$dpth + 1, $$cr)) !== null) {
|
|
186
187
|
$$res = new Ranges_1($scope$car, $scope$cdr);
|
|
187
188
|
}
|
|
188
189
|
return $$res;
|
|
@@ -192,8 +193,7 @@ class Parser {
|
|
|
192
193
|
return this.run($$dpth, () => {
|
|
193
194
|
let $scope$range;
|
|
194
195
|
let $$res = null;
|
|
195
|
-
if (true
|
|
196
|
-
&& ($scope$range = this.matchRange($$dpth + 1, $$cr)) !== null) {
|
|
196
|
+
if (true && ($scope$range = this.matchRange($$dpth + 1, $$cr)) !== null) {
|
|
197
197
|
$$res = new Ranges_2($scope$range);
|
|
198
198
|
}
|
|
199
199
|
return $$res;
|
|
@@ -203,7 +203,7 @@ class Parser {
|
|
|
203
203
|
return this.memoise(() => {
|
|
204
204
|
return this.choice([
|
|
205
205
|
() => this.matchRange_1($$dpth + 1, $$cr),
|
|
206
|
-
() => this.matchRange_2($$dpth + 1, $$cr)
|
|
206
|
+
() => this.matchRange_2($$dpth + 1, $$cr)
|
|
207
207
|
]);
|
|
208
208
|
}, this.$scope$Range$memo);
|
|
209
209
|
}
|
|
@@ -213,16 +213,17 @@ class Parser {
|
|
|
213
213
|
let $scope$start;
|
|
214
214
|
let $scope$end;
|
|
215
215
|
let $$res = null;
|
|
216
|
-
if (true
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
216
|
+
if (true &&
|
|
217
|
+
this.match_($$dpth + 1, $$cr) !== null &&
|
|
218
|
+
(($scope$exclude = this.regexAccept(String.raw `(?:-)`, $$dpth + 1, $$cr)) ||
|
|
219
|
+
true) &&
|
|
220
|
+
this.match_($$dpth + 1, $$cr) !== null &&
|
|
221
|
+
($scope$start = this.matchCodePoint($$dpth + 1, $$cr)) !== null &&
|
|
222
|
+
this.match_($$dpth + 1, $$cr) !== null &&
|
|
223
|
+
this.regexAccept(String.raw `(?:..)`, $$dpth + 1, $$cr) !== null &&
|
|
224
|
+
this.match_($$dpth + 1, $$cr) !== null &&
|
|
225
|
+
($scope$end = this.matchCodePoint($$dpth + 1, $$cr)) !== null &&
|
|
226
|
+
this.match_($$dpth + 1, $$cr) !== null) {
|
|
226
227
|
$$res = new Range_1($scope$exclude, $scope$start, $scope$end);
|
|
227
228
|
}
|
|
228
229
|
return $$res;
|
|
@@ -233,12 +234,13 @@ class Parser {
|
|
|
233
234
|
let $scope$exclude;
|
|
234
235
|
let $scope$at;
|
|
235
236
|
let $$res = null;
|
|
236
|
-
if (true
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
237
|
+
if (true &&
|
|
238
|
+
this.match_($$dpth + 1, $$cr) !== null &&
|
|
239
|
+
(($scope$exclude = this.regexAccept(String.raw `(?:-)`, $$dpth + 1, $$cr)) ||
|
|
240
|
+
true) &&
|
|
241
|
+
this.match_($$dpth + 1, $$cr) !== null &&
|
|
242
|
+
($scope$at = this.matchCodePoint($$dpth + 1, $$cr)) !== null &&
|
|
243
|
+
this.match_($$dpth + 1, $$cr) !== null) {
|
|
242
244
|
$$res = new Range_2($scope$exclude, $scope$at);
|
|
243
245
|
}
|
|
244
246
|
return $$res;
|
|
@@ -249,9 +251,9 @@ class Parser {
|
|
|
249
251
|
return this.run($$dpth, () => {
|
|
250
252
|
let $scope$literal;
|
|
251
253
|
let $$res = null;
|
|
252
|
-
if (true
|
|
253
|
-
|
|
254
|
-
|
|
254
|
+
if (true &&
|
|
255
|
+
(this.matchPrefix($$dpth + 1, $$cr) || true) &&
|
|
256
|
+
($scope$literal = this.regexAccept(String.raw `(?:[0-9A-Fa-f]+)`, $$dpth + 1, $$cr)) !== null) {
|
|
255
257
|
$$res = new CodePoint($scope$literal);
|
|
256
258
|
}
|
|
257
259
|
return $$res;
|
|
@@ -263,7 +265,7 @@ class Parser {
|
|
|
263
265
|
return this.choice([
|
|
264
266
|
() => this.matchPrefix_1($$dpth + 1, $$cr),
|
|
265
267
|
() => this.matchPrefix_2($$dpth + 1, $$cr),
|
|
266
|
-
() => this.matchPrefix_3($$dpth + 1, $$cr)
|
|
268
|
+
() => this.matchPrefix_3($$dpth + 1, $$cr)
|
|
267
269
|
]);
|
|
268
270
|
}, this.$scope$Prefix$memo);
|
|
269
271
|
}
|
|
@@ -280,18 +282,18 @@ class Parser {
|
|
|
280
282
|
return this.memoise(() => {
|
|
281
283
|
return this.choice([
|
|
282
284
|
() => this.matchSeparator_1($$dpth + 1, $$cr),
|
|
283
|
-
() => this.matchSeparator_2($$dpth + 1, $$cr)
|
|
285
|
+
() => this.matchSeparator_2($$dpth + 1, $$cr)
|
|
284
286
|
]);
|
|
285
287
|
}, this.$scope$Separator$memo);
|
|
286
288
|
}
|
|
287
289
|
matchSeparator_1($$dpth, $$cr) {
|
|
288
290
|
return this.run($$dpth, () => {
|
|
289
291
|
let $$res = null;
|
|
290
|
-
if (true
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
$$res = { kind: ASTKinds.Separator_1
|
|
292
|
+
if (true &&
|
|
293
|
+
this.match_($$dpth + 1, $$cr) !== null &&
|
|
294
|
+
this.regexAccept(String.raw `(?:[,;])`, $$dpth + 1, $$cr) !== null &&
|
|
295
|
+
this.match__($$dpth + 1, $$cr) !== null) {
|
|
296
|
+
$$res = { kind: ASTKinds.Separator_1 };
|
|
295
297
|
}
|
|
296
298
|
return $$res;
|
|
297
299
|
});
|
|
@@ -313,11 +315,12 @@ class Parser {
|
|
|
313
315
|
return this.memoise(() => {
|
|
314
316
|
return this.run($$dpth, () => {
|
|
315
317
|
let $$res = null;
|
|
316
|
-
if (true
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
$$
|
|
318
|
+
if (true &&
|
|
319
|
+
this.match_($$dpth + 1, $$cr) !== null &&
|
|
320
|
+
this.regexAccept(String.raw `(?:(?:#[^\r\n]*)?[\r\n])`, $$dpth + 1, $$cr) !==
|
|
321
|
+
null &&
|
|
322
|
+
this.match__($$dpth + 1, $$cr) !== null) {
|
|
323
|
+
$$res = { kind: ASTKinds.___ };
|
|
321
324
|
}
|
|
322
325
|
return $$res;
|
|
323
326
|
});
|
|
@@ -390,7 +393,7 @@ class Parser {
|
|
|
390
393
|
// We substring from 3 to len - 1 to strip off the
|
|
391
394
|
// non-capture group syntax added as a WebKit workaround
|
|
392
395
|
literal: match.substring(3, match.length - 1),
|
|
393
|
-
negated: this.negating
|
|
396
|
+
negated: this.negating
|
|
394
397
|
});
|
|
395
398
|
}
|
|
396
399
|
return res;
|
|
@@ -410,7 +413,7 @@ class Parser {
|
|
|
410
413
|
this.pos = {
|
|
411
414
|
overallPos: reg.lastIndex,
|
|
412
415
|
line: this.pos.line + lineJmp,
|
|
413
|
-
offset: lind === -1 ? this.pos.offset + res[0].length :
|
|
416
|
+
offset: lind === -1 ? this.pos.offset + res[0].length : res[0].length - lind - 1
|
|
414
417
|
};
|
|
415
418
|
return res[0];
|
|
416
419
|
}
|
|
@@ -449,14 +452,13 @@ function parse(s) {
|
|
|
449
452
|
const p = new Parser(s);
|
|
450
453
|
return p.parse();
|
|
451
454
|
}
|
|
452
|
-
exports.parse = parse;
|
|
453
455
|
class SyntaxErr {
|
|
454
456
|
constructor(pos, expmatches) {
|
|
455
457
|
this.pos = pos;
|
|
456
458
|
this.expmatches = [...expmatches];
|
|
457
459
|
}
|
|
458
460
|
toString() {
|
|
459
|
-
return `Syntax Error at line ${this.pos.line}:${this.pos.offset}. Expected one of ${this.expmatches.map(x => x.kind === "EOF" ? " EOF" : ` ${x.negated ?
|
|
461
|
+
return `Syntax Error at line ${this.pos.line}:${this.pos.offset}. Expected one of ${this.expmatches.map(x => (x.kind === "EOF" ? " EOF" : ` ${x.negated ? "not " : ""}'${x.literal}'`))}`;
|
|
460
462
|
}
|
|
461
463
|
}
|
|
462
464
|
exports.SyntaxErr = SyntaxErr;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.IntroSyntax = void 0;
|
|
4
|
+
exports.loadFontFromFile = loadFontFromFile;
|
|
4
5
|
const Fs = require("fs");
|
|
5
6
|
const Path = require("path");
|
|
6
7
|
const cli_help_shower_1 = require("@ot-builder/cli-help-shower");
|
|
@@ -31,5 +32,4 @@ async function loadFontFromFile(path, gsf, cfg) {
|
|
|
31
32
|
const bufFont = await Fs.promises.readFile(Path.resolve(path));
|
|
32
33
|
return ot_builder_1.FontIo.readFont(ot_builder_1.FontIo.readSfntOtf(bufFont), gsf, cfg);
|
|
33
34
|
}
|
|
34
|
-
exports.loadFontFromFile = loadFontFromFile;
|
|
35
35
|
//# sourceMappingURL=intro.js.map
|
|
@@ -32,7 +32,7 @@ exports.MergeSyntax = {
|
|
|
32
32
|
.indent("")
|
|
33
33
|
.message("Merge the font on the stack top to the font below it.")
|
|
34
34
|
.message(`In a typical use like:`, cli_help_shower_1.Style.Cmd `otb-cli`, cli_help_shower_1.Style.Arg `a.ttf`, cli_help_shower_1.Style.Arg `b.ttf`, cli_help_shower_1.Style.Option `--merge`, cli_help_shower_1.Style.Option `-o`, cli_help_shower_1.Style.Arg `ab.ttf`, `, metadata and naming will follow`, cli_help_shower_1.Style.Arg `a.ttf`, `while glyphs from`, cli_help_shower_1.Style.Arg `b.ttf`, `will be added to it.`)
|
|
35
|
-
.message(`When`, cli_help_shower_1.Style.Option
|
|
35
|
+
.message(`When`, cli_help_shower_1.Style.Option `--override`, `is provided, characters from`, cli_help_shower_1.Style.Arg `b.ttf`, `will be preferred; otherwise, characters from`, cli_help_shower_1.Style.Arg `a.ttf`, `will be preferred.`);
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
//# sourceMappingURL=merge.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.SaveSyntax = void 0;
|
|
4
|
+
exports.saveFontToFile = saveFontToFile;
|
|
4
5
|
const Fs = require("fs");
|
|
5
6
|
const Path = require("path");
|
|
6
7
|
const cli_help_shower_1 = require("@ot-builder/cli-help-shower");
|
|
@@ -33,5 +34,4 @@ async function saveFontToFile(path, font, cfg) {
|
|
|
33
34
|
const buf1 = ot_builder_1.FontIo.writeSfntOtf(ot_builder_1.FontIo.writeFont(font, cfg));
|
|
34
35
|
await Fs.promises.writeFile(Path.resolve(path), buf1);
|
|
35
36
|
}
|
|
36
|
-
exports.saveFontToFile = saveFontToFile;
|
|
37
37
|
//# sourceMappingURL=save.js.map
|
|
@@ -2,8 +2,9 @@ import { CliHelpShower } from "@ot-builder/cli-help-shower";
|
|
|
2
2
|
import { ParseState } from "../../argv-parser";
|
|
3
3
|
import { Grammar, Syntax } from "../../command";
|
|
4
4
|
export declare class StartSyntax<T> implements Syntax<T> {
|
|
5
|
+
private readonly appVersion;
|
|
5
6
|
private readonly body;
|
|
6
|
-
constructor(body: Syntax<T>);
|
|
7
|
+
constructor(appVersion: string, body: Syntax<T>);
|
|
7
8
|
handle(st0: ParseState, grammar: Grammar): import("../../argv-parser").ParseResult<T>;
|
|
8
9
|
displayHelp(shower: CliHelpShower): void;
|
|
9
10
|
}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.StartSyntax = void 0;
|
|
4
4
|
const cli_help_shower_1 = require("@ot-builder/cli-help-shower");
|
|
5
|
-
const package_version_1 = require("../../package-version");
|
|
6
5
|
class StartSyntax {
|
|
7
|
-
constructor(body) {
|
|
6
|
+
constructor(appVersion, body) {
|
|
7
|
+
this.appVersion = appVersion;
|
|
8
8
|
this.body = body;
|
|
9
9
|
}
|
|
10
10
|
handle(st0, grammar) {
|
|
@@ -13,7 +13,7 @@ class StartSyntax {
|
|
|
13
13
|
displayHelp(shower) {
|
|
14
14
|
shower
|
|
15
15
|
.message()
|
|
16
|
-
.message('ot-builder CLI utility program "otb-cli",', "version",
|
|
16
|
+
.message('ot-builder CLI utility program "otb-cli",', "version", this.appVersion)
|
|
17
17
|
.message(cli_help_shower_1.Style.Rule)
|
|
18
18
|
.message(`Usage :`);
|
|
19
19
|
this.body.displayHelp(shower);
|
|
@@ -9,7 +9,7 @@ exports.VersionSyntax = {
|
|
|
9
9
|
if (!st.isOption("--version", "-v"))
|
|
10
10
|
return (0, argv_parser_1.ParseResult)(st, null);
|
|
11
11
|
return (0, argv_parser_1.ParseResult)(st.next(), async (state) => {
|
|
12
|
-
console.log(package_version_1.
|
|
12
|
+
console.log(await (0, package_version_1.getPackageVersion)());
|
|
13
13
|
});
|
|
14
14
|
},
|
|
15
15
|
displayHelp(shower) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ot-builder-cli",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.5",
|
|
4
4
|
"bin": {
|
|
5
5
|
"otb-cli": "./bin/otb-cli"
|
|
6
6
|
},
|
|
@@ -26,14 +26,13 @@
|
|
|
26
26
|
"access": "public"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"tslib": "^2.
|
|
30
|
-
"
|
|
31
|
-
"ot-builder": "1.7.
|
|
32
|
-
"@ot-builder/cli-
|
|
33
|
-
"@ot-builder/cli-shared": "1.7.3"
|
|
29
|
+
"tslib": "^2.8.1",
|
|
30
|
+
"ot-builder": "1.7.5",
|
|
31
|
+
"@ot-builder/cli-help-shower": "1.7.5",
|
|
32
|
+
"@ot-builder/cli-shared": "1.7.5"
|
|
34
33
|
},
|
|
35
34
|
"devDependencies": {
|
|
36
|
-
"@types/jest": "^29.5.
|
|
37
|
-
"jest": "^29.
|
|
35
|
+
"@types/jest": "^29.5.14",
|
|
36
|
+
"jest": "^29.7.0"
|
|
38
37
|
}
|
|
39
38
|
}
|