diff --git a/script-meta-v2.json b/script-meta-v2.json index 3a5fb99..55bd2f7 100644 --- a/script-meta-v2.json +++ b/script-meta-v2.json @@ -159,12 +159,12 @@ }, "message.ts": { "script_name": "message.ts", - "script_length": 1053, - "script_sha256": "410db83a1e2c7d21d1eb324a545d0c8208f67c10b80a06fa7ad8123553d9786e", + "script_length": 1791, + "script_sha256": "7c837640d6f607b15c4ebc3c590bf86784ebec2a7ce7cd2ef98edba8a7929a68", "script_full_url": "https://git.hatter.ink/hatter/ts-scripts/raw/branch/main/single-scripts/message.ts", "single_script_file": true, "publish_time": 1770129305453, - "update_time": 1770133790553 + "update_time": 1770538595147 }, "post-note.ts": { "script_name": "post-note.ts", diff --git a/single-scripts/message.ts b/single-scripts/message.ts index 9a0b513..2262daa 100755 --- a/single-scripts/message.ts +++ b/single-scripts/message.ts @@ -1,5 +1,5 @@ #!/usr/bin/env runts -- --allow-import -import {log} from "https://global.hatter.ink/script/get/@18/deno-commons-mod.ts"; +import {log, term,} from "https://global.hatter.ink/script/get/@33/deno-commons-mod.ts"; import {parseArgs} from "jsr:@std/cli/parse-args"; function main() { @@ -12,6 +12,13 @@ function main() { "warn", "warning", "error", + "bold", + "under", + "auto", + ], + string: [ + "color", + "bgcolor", ], }); @@ -31,11 +38,31 @@ function main() { } else if (flags.debug) { log.debug(...flags._); } else { - console.log(flags._.join(' ')); + if (flags.auto) { + console.log(term.auto(flags._.join(" "))); + } else { + const sb: string[] = []; + if (flags.color) { + sb.push(`[${flags.color}]`); + } + if (flags.bold) { + sb.push(`[bold]`); + } + if (flags.under) { + sb.push(`[under]`); + } + if (flags.bgcolor) { + sb.push(`[bg_${flags.bgcolor}]`); + } + sb.push("[[["); + sb.push(flags._.join(" ")); + sb.push("]]]"); + console.log(term.auto(sb.join(""))); + } } } main(); -// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20260203T234925+08:00.MEQCIHHUP+yyL547VOxi5cwT -// ekRl7ckyStN+s0Ni3aICU9tzAiBKydlOovYShx9a/9SP2W4vMOiA1ABsWwHupiBovZaXsg== +// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20260208T161629+08:00.MEUCIQD2GNZVw70Ke2g12xC+ +// FHqhxP0o8IK1WcMmijGRjoCIEwIgK2svmajusuU7quHyIurV6JnRp9fLzElmA/wmVwuLv1A=