You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow multiple files on the command line, all of which get combined into one output. Not ready. Still needs change to source-map generation, for topLevelInitializer to be an array, and to make moving imports to the top of all topLevelInitializers (keeping track of source info) a JS-specific pass.
Copy file name to clipboardExpand all lines: bin/peggy-cli.js
+43-39Lines changed: 43 additions & 39 deletions
Original file line number
Diff line number
Diff line change
@@ -94,8 +94,8 @@ class PeggyCLI extends Command {
94
94
95
95
/** @type {peggy.BuildOptionsBase} */
96
96
this.argv={};
97
-
/** @type {string?} */
98
-
this.inputFile=null;
97
+
/** @type {string[]} */
98
+
this.inputFiles=[];
99
99
/** @type {string?} */
100
100
this.outputFile=null;
101
101
/** @type {object} */
@@ -115,7 +115,7 @@ class PeggyCLI extends Command {
115
115
116
116
this
117
117
.version(peggy.VERSION,"-v, --version")
118
-
.argument("[input_file]",'Grammar file to read. Use "-" to read stdin.',"-")
118
+
.argument("[input_file...]",'Grammar file(s) to read. Use "-" to read stdin. If multiple files are given, they are combined in the given order to produce a single output.',["-"])
119
119
.allowExcessArguments(false)
120
120
.addOption(
121
121
newOption(
@@ -214,8 +214,8 @@ class PeggyCLI extends Command {
214
214
.hideHelp()
215
215
.default(false)
216
216
)
217
-
.action((inputFile,opts)=>{// On parse()
218
-
this.inputFile=inputFile;
217
+
.action((inputFiles,opts)=>{// On parse()
218
+
this.inputFiles=inputFiles;
219
219
this.argv=opts;
220
220
221
221
if((typeofthis.argv.startRule==="string")
@@ -284,21 +284,24 @@ class PeggyCLI extends Command {
0 commit comments