gadl/main.ts
2023-11-08 00:59:13 +09:00

22 lines
393 B
TypeScript

import util from "node:util";
const options = {
help: {
type: "boolean",
default: true,
run() {
console.log(
[
"Available options:",
...Object.keys(options).map((option) => ` --${option}`),
].join("\n"),
);
},
},
} as const;
const args = util.parseArgs({ options });
if (args.values.help) {
await options.help.run();
}