"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const commander_1 = require("commander");
const node_path_1 = __importDefault(require("node:path"));
const generateNegativeTestsFile_1 = require("./generate/generateNegativeTestsFile");
const program = new commander_1.Command();
program
    .name('gremlin')
    .description('Generate additional (negative) Playwright tests using pluggable strategies')
    .argument('<testFile>', 'Path to an input Playwright .spec.ts file')
    .option('-o, --output <dir>', 'Output directory (relative to input test file directory when relative)')
    .option('--project <tsconfig>', 'Path to tsconfig.json to use for type-aware analysis (defaults to nearest tsconfig.json above the input file)')
    .action(async (testFile, options) => {
    const inputPath = node_path_1.default.resolve(process.cwd(), testFile);
    const result = await (0, generateNegativeTestsFile_1.generateNegativeTestsFile)({
        inputTestFilePath: inputPath,
        outputDir: options.output,
        tsConfigPath: options.project,
    });
    // eslint-disable-next-line no-console
    console.log(result.outputFilePath);
});
program.parseAsync(process.argv).catch((error) => {
    // eslint-disable-next-line no-console
    console.error(error);
    process.exitCode = 1;
});
