<commit_before>import { read } from "../internal/input";
import { writeOutput } from "../internal/util";

async function apibCmd(input, { output, quiet }) {
  const source = read(input);

  writeOutput(output, source);

  if (!quiet && output) {
    console.log("%s: API blueprint has been generated", output);
  }
}

export default apibCmd;<commit_msg>update apib command<commit_after>import { Command, flags } from "@oclif/command";
import { read } from "../internal/input";
import { writeFile } from "../util";

class ApibCommand extends Command {
  static args = [{ name: "input", required: true }];

  async run() {
    const { flags, args } = this.parse(ApibCommand);

    if (!flags.output && flags.quiet) {
      this.error("--quiet cannot be used when no --output=");
    }

    const source = read(args.input);

    if (flags.output) {
      await writeFile(flags.output, source);
    } else {
      this.log(source);
    }

    if (!flags.quiet && flags.output) {
      this.log("%s: API blueprint has been saved", flags.output);
    }
  }
}

ApibCommand.description = `render API blueprint`;

ApibCommand.flags = {
  output: flags.string({ char: "o", description: "output file" }),
  quiet: flags.boolean({ char: "q", description: "quiet mode" })
};

export default ApibCommand;
{'fraction_non_alphanumeric': 0.15891472868217055, 'fraction_numerical': 0.0, 'mean_word_length': 3.4517241379310346, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '312690', 'n_tokens_mistral': 404, 'n_tokens_neox': 392, 'n_words': 114}