Make quote marks consistent in error/warning messages (#1791)

- "Double quotes" for strings (filenames, section names, CLI option arguments, etc)
- 'Single quotes' for characters and CLI option flags
- `Backticks` for keywords and identifiers (symbol names, charmap names, etc)

CLI option flags also have their leading dashes
This commit is contained in:
Rangi
2025-08-12 15:24:21 -04:00
committed by GitHub
parent 7df9c12a6c
commit 7b405513d9
185 changed files with 889 additions and 877 deletions

View File

@@ -70,13 +70,11 @@ void parseInlinePalSpec(char const * const rawArg) {
error("%s", msg); // `format_` and `-Wformat-security` would complain about `error(msg);`
fprintf(
stderr,
"In inline palette spec: %s\n"
" ",
rawArg
"In inline palette spec: \"%s\"\n%*c",
rawArg,
static_cast<int>(literal_strlen("In inline palette spec: \"") + ofs),
' '
);
for (size_t i = ofs; i; --i) {
putc(' ', stderr);
}
for (size_t i = len; i; --i) {
putc('^', stderr);
}
@@ -300,7 +298,7 @@ static void parsePSPFile(char const *filename, std::filebuf &file) {
size_t n = 0;
std::optional<uint16_t> nbColors = parseDec<uint16_t>(line, n);
if (!nbColors || n != line.length()) {
error("Invalid \"number of colors\" line in PSP file (%s)", line.c_str());
error("Invalid \"number of colors\" line in PSP file (\"%s\")", line.c_str());
return;
}
@@ -651,7 +649,7 @@ void parseExternalPalSpec(char const *arg) {
// Split both parts, error out if malformed
char const *ptr = strchr(arg, ':');
if (ptr == nullptr) {
error("External palette spec must have format `fmt:path` (missing colon)");
error("External palette spec must have format \"fmt:path\" (missing colon)");
return;
}
char const *path = ptr + 1;
@@ -721,7 +719,7 @@ void parseBackgroundPalSpec(char const *arg) {
}
if (arg[0] != '#') {
error("Background color specification must be `#rgb`, `#rrggbb`, or `transparent`");
error("Background color specification must be \"#rgb\", \"#rrggbb\", or \"transparent\"");
return;
}