20 std::string input_path;
21 std::string output_path;
23 if (!command_line.
GetOptionValue(
"templater-input", &input_path)) {
25 <<
"Input template path not specified. Use --templater-input.";
28 if (!command_line.
GetOptionValue(
"templater-output", &output_path)) {
30 <<
"Input template path not specified. Use --templater-output.";
36 FML_LOG(ERROR) <<
"Could not open input file: " << input_path;
40 nlohmann::json arguments;
41 for (
const auto& option : command_line.
options()) {
42 arguments[option.name] = option.value;
44 inja::Environment env;
45 auto rendered_template = env.render(
46 std::string_view{
reinterpret_cast<const char*
>(
input->GetMapping()),
50 reinterpret_cast<const uint8_t*
>(rendered_template.data()),
51 rendered_template.size()};
56 if (!current_dir.is_valid()) {
57 FML_LOG(ERROR) <<
"Could not open current directory.";
61 FML_LOG(ERROR) <<
"Could not write output to path: " << output_path;
int main(int argc, char const *argv[])