1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 12:28:22 +01:00

Pretty-print for string2index

Turns unhelpful
wmaker: warning: wrong option value for key "NewStyle". Should be one of new, old, next
into helpful
wmaker: warning: wrong option value for key "NewStyle". Got "YES", should be one of "new", "old", "next"

Signed-off-by: Tamas TEVESZ <ice@extreme.hu>
This commit is contained in:
Tamas TEVESZ
2010-09-22 23:01:03 +02:00
committed by Carlos R. Mafra
parent 6483b198d3
commit 2bc0c1124a

View File

@@ -1206,10 +1206,14 @@ static int string2index(WMPropList * key, WMPropList * val, char *def, WOptionEn
if (!v->is_alias) { if (!v->is_alias) {
if (buffer[0] != 0) if (buffer[0] != 0)
strcat(buffer, ", "); strcat(buffer, ", ");
strcat(buffer, v->string); snprintf(buffer+strlen(buffer),
sizeof(buffer)-strlen(buffer)-1, "\"%s\"", v->string);
} }
} }
wwarning(_("wrong option value for key \"%s\". Should be one of %s"), WMGetFromPLString(key), buffer); wwarning(_("wrong option value for key \"%s\". Got \"%s\", should be one of %s"),
WMGetFromPLString(key),
WMIsPLString(val) ? WMGetFromPLString(val) : "(unknown)",
buffer);
if (def) { if (def) {
return string2index(key, val, NULL, values); return string2index(key, val, NULL, values);