import { Command } from "@oclif/core";
import { makeKnownFailuresFlags } from "../../command-helpers.mjs";
import { runKnownFailuresValidateCommand } from "../../known-failures.mjs";

export default class KnownFailuresValidateCommand extends Command {
  static summary = "Validate known failures against the latest status artifact";

  static enableJsonFlag = true;

  static flags = makeKnownFailuresFlags();

  async run() {
    const { flags } = await this.parse(KnownFailuresValidateCommand);
    await runKnownFailuresValidateCommand({
      ...flags,
      issueMode: flags["issue-mode"] || null,
    });
    return { ok: true };
  }
}
