21 std::string input_path;
22 std::string output_path;
24 if (!command_line.
GetOptionValue(
"templater-input", &input_path)) {
26 <<
"Input template path not specified. Use --templater-input.";
29 if (!command_line.
GetOptionValue(
"templater-output", &output_path)) {
31 <<
"Input template path not specified. Use --templater-output.";
37 FML_LOG(ERROR) <<
"Could not open input file: " << input_path;
41 nlohmann::json arguments;
42 for (
const auto& option : command_line.
options()) {
43 arguments[option.name] = option.value;
45 inja::Environment env;
46 auto rendered_template = env.render(
47 std::string_view{
reinterpret_cast<const char*
>(
input->GetMapping()),
51 reinterpret_cast<const uint8_t*
>(rendered_template.data()),
52 rendered_template.size()};
57 if (!current_dir.is_valid()) {
58 FML_LOG(ERROR) <<
"Could not open current directory.";
62 FML_LOG(ERROR) <<
"Could not write output to path: " << output_path;
int main(int argc, char const *argv[])