Skip to content

Commit

Permalink
gen2e-cli: include path controlling flags
Browse files Browse the repository at this point in the history
  • Loading branch information
rhighs committed Jun 26, 2024
1 parent a309869 commit dbe42a2
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions packages/gen2e-cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import { program } from "commander";
import util from "util";
import path from "path";
import readline from "readline";
import { type Gen2EExpression, StaticGenStep } from "@rhighs/gen2e";
import {
type Gen2EExpression,
StaticGenStep,
staticStoreEnabled,
} from "@rhighs/gen2e";
import { makeLogger } from "@rhighs/gen2e-logger";
import { recordingInterpreter } from "@rhighs/gen2e-interpreter";
import { Gen2EPOGenerator, loadDumps } from "@rhighs/gen2e-po";
Expand Down Expand Up @@ -417,11 +421,15 @@ program
.command("po-gen")
.description("generate a page objects via test dumps")
.argument("[dumppath]", "directory path containing test json dumps")
.action(async (dumppath, _options) => {
.option("-d, --root-dir <rootDir>")
.action(async (dumppath, options) => {
const dpath = dumppath;

const dumps = await loadDumps(dpath);
const generator = new Gen2EPOGenerator({ debug: true });
const generator = new Gen2EPOGenerator({
debug: true,
staticDataDir: options.rootDir,
});

for (let dump of dumps) {
const blocks = dump.blocks.map((b) => b.blocks).flat();
Expand Down

0 comments on commit dbe42a2

Please sign in to comment.