📝 Update script metadata and improve argument parsing in init-tsscript.ts

This commit is contained in:
2026-04-16 01:07:11 +08:00
parent d72c0d7501
commit 9eeadaf7e9
2 changed files with 11 additions and 7 deletions

View File

@@ -180,12 +180,12 @@
}, },
"init-tsscript.ts": { "init-tsscript.ts": {
"script_name": "init-tsscript.ts", "script_name": "init-tsscript.ts",
"script_length": 1992, "script_length": 2078,
"script_sha256": "96d48a09b9cea9944fabea51aacdac1c8abbff9c29e7d343bfcc279abb1a8480", "script_sha256": "2e9c9c6d44f1a2b5c8899c20439397f91caa97fa6f573e550ca589ca9bbf7cac",
"script_full_url": "https://git.hatter.ink/hatter/ts-scripts/raw/branch/main/single-scripts/init-tsscript.ts", "script_full_url": "https://git.hatter.ink/hatter/ts-scripts/raw/branch/main/single-scripts/init-tsscript.ts",
"single_script_file": true, "single_script_file": true,
"publish_time": 1776008182540, "publish_time": 1776008182540,
"update_time": 1776008182540 "update_time": 1776272822216
}, },
"ip.ts": { "ip.ts": {
"script_name": "ip.ts", "script_name": "ip.ts",

View File

@@ -44,16 +44,20 @@ import {exit, log, } from "../libraries/deno-commons-mod.ts";
function parseFlags(): any { function parseFlags(): any {
const flags = parseArgs(Deno.args, { const flags = parseArgs(Deno.args, {
boolean: ["help"] boolean: ["help"],
alias: {
h: "help",
},
}); });
const helpMessage = \`${scriptName} - DESCRIPTION const helpMessage = \`${scriptName} - DESCRIPTION
HELP MESSAGE DETAILS ----- TODO HELP MESSAGE DETAILS -----
\`; \`;
if (flags.help) { if (flags.help) {
console.log(helpMessage); console.log(helpMessage);
exit(0); exit(0);
} }
return flags;
} }
async function main(): Promise<void> { async function main(): Promise<void> {
@@ -78,5 +82,5 @@ main().catch((err) => {
exit(1); exit(1);
}).then(() => exit(0)); }).then(() => exit(0));
// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20260412T233613+08:00.MEUCIQD3Rqq2Owkh/5me60Zf // @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20260416T010643+08:00.MEYCIQCAzfRe5exq023/xi+1
// VS+LqBwz6gOkpHPIWyHJsbBkMAIgd68qrBPr9Dro9p9WUv5GvZ2+7LZTdA/Ub2cTh5MhRxc= // i2xAdACp+B2Q5b6tVkGpdrvrlgIhANQZPKALwdaRNgG2SkckWZxonnaMwbVCjyjFYmq/FXqb