added -N argument to read command

This commit is contained in:
john30
2017-04-22 16:06:52 +02:00
parent 586a21fc9f
commit b9a9e7ba53
3 changed files with 33 additions and 16 deletions
+9 -1
View File
@@ -718,8 +718,16 @@ result_t ValueListDataField::readSymbols(const SymbolString& input,
} else if (outputFormat & OF_NUMERIC) {
output << setw(0) << dec << static_cast<unsigned>(value);
} else if (outputFormat & OF_JSON) {
output << '"' << it->second << '"';
if (outputFormat & OF_VALUENAME) {
output << "{\"value\":" << setw(0) << dec << static_cast<unsigned>(value);
output << ",\"name\":\"" << it->second << "\"}";
} else {
output << '"' << it->second << '"';
}
} else {
if (outputFormat & OF_VALUENAME) {
output << setw(0) << dec << static_cast<unsigned>(value) << '=';
}
output << it->second;
}
return RESULT_OK;