summaryrefslogtreecommitdiffstats
path: root/.github/workflows/test-unit-cli.yml
diff options
context:
space:
mode:
authorHenrique Joaquim <henriquecjoaquim@gmail.com>2024-06-07 11:57:23 +0100
committerGitHub <noreply@github.com>2024-06-07 10:57:23 +0000
commitaa7bccc4eccc67764ecd3a62f1e7c5f8323cbac0 (patch)
tree28fd5be48d94ad7f16a23095b4384d88165ea6ea /.github/workflows/test-unit-cli.yml
parentd7a9e666b98a7456d8bcc01c1ae7d026a2a566b3 (diff)
[Feature] CLI logging (#6487)v4.2.2v4.2.1v4.2.0
* remove old logging references * cli as logging subapp option * changing the subapp to the cli on init
Diffstat (limited to '.github/workflows/test-unit-cli.yml')
0 files changed, 0 insertions, 0 deletions
s="n">attr & GRID_ATTR_CHARSET) ? "acs," : "", (attr & GRID_ATTR_BRIGHT) ? "bright," : "", (attr & GRID_ATTR_DIM) ? "dim," : "", (attr & GRID_ATTR_UNDERSCORE) ? "underscore," : "", (attr & GRID_ATTR_BLINK)? "blink," : "", (attr & GRID_ATTR_REVERSE) ? "reverse," : "", (attr & GRID_ATTR_HIDDEN) ? "hidden," : "", (attr & GRID_ATTR_ITALICS) ? "italics," : "", (attr & GRID_ATTR_STRIKETHROUGH) ? "strikethrough," : "", (attr & GRID_ATTR_UNDERSCORE_2) ? "double-underscore," : "", (attr & GRID_ATTR_UNDERSCORE_3) ? "curly-underscore," : "", (attr & GRID_ATTR_UNDERSCORE_4) ? "dotted-underscore," : "", (attr & GRID_ATTR_UNDERSCORE_5) ? "dashed-underscore," : "", (attr & GRID_ATTR_OVERLINE) ? "overline," : ""); if (len > 0) buf[len - 1] = '\0'; return (buf); } int attributes_fromstring(const char *str) { const char delimiters[] = " ,|"; int attr; size_t end; u_int i; struct { const char *name; int attr; } table[] = { { "acs", GRID_ATTR_CHARSET }, { "bright", GRID_ATTR_BRIGHT }, { "bold", GRID_ATTR_BRIGHT }, { "dim", GRID_ATTR_DIM }, { "underscore", GRID_ATTR_UNDERSCORE }, { "blink", GRID_ATTR_BLINK }, { "reverse", GRID_ATTR_REVERSE }, { "hidden", GRID_ATTR_HIDDEN }, { "italics", GRID_ATTR_ITALICS }, { "strikethrough", GRID_ATTR_STRIKETHROUGH }, { "double-underscore", GRID_ATTR_UNDERSCORE_2 }, { "curly-underscore", GRID_ATTR_UNDERSCORE_3 }, { "dotted-underscore", GRID_ATTR_UNDERSCORE_4 }, { "dashed-underscore", GRID_ATTR_UNDERSCORE_5 }, { "overline", GRID_ATTR_OVERLINE } }; if (*str == '\0' || strcspn(str, delimiters) == 0) return (-1); if (strchr(delimiters, str[strlen(str) - 1]) != NULL) return (-1); if (strcasecmp(str, "default") == 0 || strcasecmp(str, "none") == 0) return (0); attr = 0; do { end = strcspn(str, delimiters); for (i = 0; i < nitems(table); i++) { if (end != strlen(table[i].name)) continue; if (strncasecmp(str, table[i].name, end) == 0) { attr |= table[i].attr; break; } } if (i == nitems(table)) return (-1); str += end + strspn(str + end, delimiters); } while (*str != '\0'); return (attr); }