Tag search failures as warnings

felipesanches-svg
Marius Kintel 2013-04-19 15:57:11 -04:00
parent 7342ff7cf9
commit eb60b5f937
2 changed files with 10 additions and 10 deletions

View File

@ -449,7 +449,7 @@ Value builtin_search(const Context *, const std::vector<std::string>&, const std
if (num_returns_per_match > 1 && matchCount >= num_returns_per_match) break;
}
}
if (matchCount == 0) PRINTB(" search term not found: \"%s\"", findThis.toString()[i]);
if (matchCount == 0) PRINTB(" WARNING: search term not found: \"%s\"", findThis.toString()[i]);
if (num_returns_per_match == 0 || num_returns_per_match > 1) {
returnvec.push_back(Value(resultvec));
}
@ -478,10 +478,10 @@ Value builtin_search(const Context *, const std::vector<std::string>&, const std
}
if (num_returns_per_match == 1 && matchCount == 0) {
if (findThis.toVector()[i].type() == Value::NUMBER) {
PRINTB(" search term not found: %s",findThis.toVector()[i].toDouble());
PRINTB(" WARNING: search term not found: %s",findThis.toVector()[i].toDouble());
}
else if (findThis.toVector()[i].type() == Value::STRING) {
PRINTB(" search term not found: \"%s\"",findThis.toVector()[i].toString());
PRINTB(" WARNING: search term not found: \"%s\"",findThis.toVector()[i].toString());
}
returnvec.push_back(Value(resultvec));
}
@ -490,7 +490,7 @@ Value builtin_search(const Context *, const std::vector<std::string>&, const std
}
}
} else {
PRINTB(" search: none performed on input %s", findThis);
PRINTB(" WARNING: search: none performed on input %s", findThis);
return Value();
}
return Value(returnvec);

View File

@ -1,9 +1,9 @@
search term not found: "q"
search term not found: 1000
search term not found: "zzz"
search term not found: "zzz"
search term not found: 500
search term not found: ""
WARNING: search term not found: "q"
WARNING: search term not found: 1000
WARNING: search term not found: "zzz"
WARNING: search term not found: "zzz"
WARNING: search term not found: 500
WARNING: search term not found: ""
ECHO: "Characters in string (\"a\"): [0]"
ECHO: "Characters in string (\"adeq\"): [[0, 5], [3, 8], [4], []]"
ECHO: "Default string search (\"abe\"): [0, 1, 8]"