import { defineCommand, arg } from "politty";
import { z } from "zod";
import { executeCommand } from "../../lib/command-result";
import { runModuleSyncCheck } from "./sync-check";

export const syncCheckCommand = defineCommand({
  name: "sync-check",
  description: "Validate source <-> doc correspondence",
  args: z.object({
    path: arg(z.string(), {
      alias: "p",
      description: "Path to modules directory",
    }),
  }),
  run: (args) => {
    return executeCommand(() => runModuleSyncCheck(args.path, process.cwd()));
  },
});
