Skip to content

Commit c74d7e2

Browse files
committed
Add help info
1 parent 72b55db commit c74d7e2

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

src/parseInputs.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,19 @@ export async function parseInputs(cliInputs: string[]): Promise<ParsedInputs> {
137137
}
138138
break;
139139
}
140+
case '--weval-bin': {
141+
const value = cliInputs.shift();
142+
if (value == null) {
143+
console.error('Error: --weval-bin requires a value');
144+
process.exit(1);
145+
}
146+
if (isAbsolute(value)) {
147+
wevalBin = value;
148+
} else {
149+
wevalBin = join(process.cwd(), value);
150+
}
151+
break;
152+
}
140153
case '--aot-cache': {
141154
const value = cliInputs.shift();
142155
if (value == null) {
@@ -225,6 +238,12 @@ export async function parseInputs(cliInputs: string[]): Promise<ParsedInputs> {
225238
wasmEngine = join(__dirname, '../fastly-weval.wasm');
226239
}
227240

241+
if (wevalBin && !enableAOT) {
242+
console.error(
243+
'Warning: --weval-bin has no effect without --enable-aot, as weval is only used for AOT compilation',
244+
);
245+
}
246+
228247
return {
229248
enableExperimentalHighResolutionTimeMethods,
230249
enableHttpCache,

src/printHelp.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ OPTIONS:
2929
--enable-experimental-top-level-await Enable experimental top level await
3030
--enable-stack-traces Enable stack traces
3131
--exclude-sources Don't include sources in stack traces
32-
--debug-intermediate-files <dir> Output intermediate files in directory
32+
--debug-intermediate-files <dir> Output intermediate files in directory
33+
--weval-bin <weval-bin> Path to the weval binary to use for AOT compilation
3334
3435
ARGS:
3536
<input> The input JS script's file path [default: bin/index.js]

0 commit comments

Comments
 (0)