This commit is contained in:
Nebel 2023-11-21 00:09:06 +09:00
parent e4202f7fee
commit aac345833b
Signed by: nebel
GPG key ID: 79807D08C6EF6460

11
main.ts
View file

@ -118,6 +118,9 @@ const options = {
await library.archive(args.values["out-dir"]!);
},
},
json: {
type: "boolean",
},
help: {
type: "boolean",
short: "h",
@ -134,6 +137,14 @@ const options = {
const args = util.parseArgs({ options });
if (args.values.json) {
console.dir = function dir(arrayOrObject) {
for (const obj of [arrayOrObject].flat()) {
console.log(JSON.stringify(obj));
}
};
}
for (const option of Object.keys(options)) {
if (args.values[option] && typeof options[option].run === "function") {
await options[option].run();