summaryrefslogtreecommitdiff
path: root/packages/pogen/src/pogen.ts
blob: 7d128ce7a9c2bf2c11dc112a25ee36d4b7abbab4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { potextract } from "./potextract.js";

function usage(): never {
  console.log("usage: pogen <extract|merge|emit>");
  process.exit(1);
}

export function main() {
  const subcommand = process.argv[2];
  if (process.argv.includes("--help") || !subcommand) {
    usage();
  }
  switch (subcommand) {
    case "extract":
      potextract();
      break;
    default:
      console.error(`unknown subcommand '${subcommand}'`);
      usage();
  }
}