}
}
void write_files(const std::filesystem::path& base,
const startgit::repository& repo,
const startgit::branch& branch)
{
for (const auto& file : branch.get_files()) {
const std::filesystem::path path = base / (file.get_path() + ".html");
std::filesystem::create_directories(path.parent_path());
std::ofstream ofs(path);
std::string back = "../";
for (const char chr : file.get_path()) {
if (chr == '/') {
back += "../";
}
}
write_header(ofs, repo, branch, file.get_path());
write_title(ofs, repo, branch.get_name(), back);
write_file_content(ofs, file);
write_footer(ofs);
}
}
int parse_opt(int key, const char* arg, poafloc::Parser* parser)
{
auto* args = static_cast<arguments_t*>(parser->input());