import { Command, Option } from "commander";
import { loadCliState, parsedArgs } from "../../shared.js";
import { runValidate } from "./action.js";
export function createValidateCommand(context, setExitCode) {
    return new Command("validate")
        .description("Validate CLI or tenant config-import files")
        .argument("[scope]")
        .argument("[path]")
        .addOption(new Option("--format <text|json>", "tenant report format")
        .choices(["text", "json"])
        .default("text"))
        .action(async (scope, path, options) => {
        const state = await loadCliState(context);
        const positionals = [scope, path].filter((value) => typeof value === "string");
        setExitCode(await runValidate(state.configPath, state.config, parsedArgs("config", "validate", positionals, options), context));
    });
}
//# sourceMappingURL=index.js.map