Make --pretty-json work with Standard JSON output

This commit is contained in:
Ladislav Sladecek
2021-07-26 16:00:46 +02:00
committed by Kamil Śliwak
parent 7041b87c3b
commit 9bbeea58c8
24 changed files with 176 additions and 26 deletions
+2 -4
View File
@@ -532,7 +532,7 @@ bool CommandLineInterface::processInput()
return false;
}
}
StandardCompiler compiler(m_fileReader.reader());
StandardCompiler compiler(m_fileReader.reader(), m_options.formatting.json);
sout() << compiler.compile(std::move(input)) << endl;
return true;
}
@@ -771,9 +771,7 @@ void CommandLineInterface::handleCombinedJSON()
}
}
string json = m_options.formatting.prettyJson ? jsonPrettyPrint(removeNullMembers(std::move(output))) :
jsonCompactPrint(removeNullMembers(std::move(output)));
string json = jsonPrint(removeNullMembers(std::move(output)), m_options.formatting.json);
if (!m_options.output.dir.empty())
createJson("combined", json);
else