diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-03-09 18:47:56 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-03-09 18:47:56 -0500 |
| commit | 5131fdff6294b075cc760a8014ef8c9b6d1bf5d8 (patch) | |
| tree | 2215901e33e0384ee97f5777508a2d2b5baaa70e /builtins | |
| parent | 77c9669d41d24a89e9364e1a91d9a1343c75537f (diff) | |
Improve handling of secret text
Diffstat (limited to 'builtins')
| -rw-r--r-- | builtins/text.c | 2 | ||||
| -rw-r--r-- | builtins/types.h | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/builtins/text.c b/builtins/text.c index 4641bc1d..70d9be57 100644 --- a/builtins/text.c +++ b/builtins/text.c @@ -25,7 +25,7 @@ public CORD Text__as_text(const void *text, bool colorize, const TypeInfo *info) { if (!text) return info->TextInfo.lang; - CORD ret = Text__quoted(*(CORD*)text, colorize); + CORD ret = info->TextInfo.secret ? "(*****)" : Text__quoted(*(CORD*)text, colorize); if (!streq(info->TextInfo.lang, "Text")) ret = colorize ? CORD_all("\x1b[1m$", info->TextInfo.lang, "\x1b[m", ret) : CORD_all("$", info->TextInfo.lang, ret); return ret; diff --git a/builtins/types.h b/builtins/types.h index d26c86be..528701ff 100644 --- a/builtins/types.h +++ b/builtins/types.h @@ -29,6 +29,7 @@ typedef struct TypeInfo { } PointerInfo; struct { const char *lang; + bool secret; } TextInfo; struct { const struct TypeInfo *item; |
