eupak: Remove old verbose lists from info command

This commit is contained in:
Lily Tsuru 2025-01-21 17:45:09 -05:00
parent 6090c5cfe6
commit 94fda4e349

View file

@ -84,38 +84,28 @@ namespace eupak {
} }
std::visit([&](auto& header) { std::visit([&](auto& header) {
std::string_view version = "???"; std::string_view version {};
// This is the best other than just duplicating the body for each pak version.. :( // This is the best other than just duplicating the body for each pak version.. :(
// sucks but it is what it is
if constexpr(std::decay_t<decltype(header)>::VERSION == estructs::PakVersion::Ver3) if constexpr(std::decay_t<decltype(header)>::VERSION == estructs::PakVersion::Ver3)
version = "Version 3 (Starfighter/Europa pre-release, May-July 2000?)"; version = "Version 3 (Starfighter pre-release)";
else if constexpr(std::decay_t<decltype(header)>::VERSION == estructs::PakVersion::Ver4) else if constexpr(std::decay_t<decltype(header)>::VERSION == estructs::PakVersion::Ver4)
version = "Version 4 (Starfighter)"; version = "Version 4 (Starfighter)";
else if constexpr(std::decay_t<decltype(header)>::VERSION == estructs::PakVersion::Ver5) else if constexpr(std::decay_t<decltype(header)>::VERSION == estructs::PakVersion::Ver5)
version = "Version 5 (Jedi Starfighter)"; version = "Version 5 (Jedi Starfighter)";
std::cout << "Archive " << currentArgs.inputPath << ":\n"; printf("Archive \"%s\": %s, created %s, %d files", currentArgs.inputPath.string().c_str(), version.data(), FormatUnixTimestamp(header.creationUnixTime, DATE_FORMAT).c_str(), header.fileCount);
std::cout << " Created: " << FormatUnixTimestamp(header.creationUnixTime, DATE_FORMAT) << '\n';
std::cout << " Version: " << version << '\n'; if(currentArgs.verbose) {
std::cout << " Size: " << FormatUnit(header.tocOffset + header.tocSize) << '\n'; printf(", data size: %s", FormatUnit(header.tocOffset + header.tocSize).c_str());
std::cout << " File Count: " << header.fileCount << " files\n"; }
printf("\n");
}, },
reader.GetHeader()); reader.GetHeader());
// Print a detailed file list if verbose.
for(auto& [filename, file] : reader.GetFiles()) { for(auto& [filename, file] : reader.GetFiles()) {
if(currentArgs.verbose) {
std::cout << "File \"" << filename << "\":\n";
file.VisitTocEntry([&](auto& tocEntry) {
std::cout << " Created: " << FormatUnixTimestamp(tocEntry.creationUnixTime, DATE_FORMAT) << '\n';
std::cout << " Size: " << FormatUnit(tocEntry.size) << '\n';
if constexpr(std::is_same_v<std::decay_t<decltype(tocEntry)>, estructs::PakHeader_V5::TocEntry_SectorAligned>) {
std::cout << " Start LBA (CD-ROM Sector): " << tocEntry.startLBA << '\n';
}
});
} else {
file.VisitTocEntry([&](auto& tocEntry) { file.VisitTocEntry([&](auto& tocEntry) {
std::printf("%16s %10s %8s", FormatUnixTimestamp(tocEntry.creationUnixTime, DATE_FORMAT).c_str(), FormatUnit(tocEntry.size).c_str(), filename.c_str()); std::printf("%16s %10s %8s", FormatUnixTimestamp(tocEntry.creationUnixTime, DATE_FORMAT).c_str(), FormatUnit(tocEntry.size).c_str(), filename.c_str());
@ -126,7 +116,6 @@ namespace eupak {
std::printf("\n"); std::printf("\n");
}); });
} }
}
return 0; return 0;
} }