eupak: Remove old verbose lists from info
command
This commit is contained in:
parent
6090c5cfe6
commit
94fda4e349
1 changed files with 17 additions and 28 deletions
|
@ -84,48 +84,37 @@ 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) {
|
file.VisitTocEntry([&](auto& tocEntry) {
|
||||||
std::cout << "File \"" << filename << "\":\n";
|
std::printf("%16s %10s %8s", FormatUnixTimestamp(tocEntry.creationUnixTime, DATE_FORMAT).c_str(), FormatUnit(tocEntry.size).c_str(), filename.c_str());
|
||||||
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>) {
|
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';
|
std::printf(" (LBA %u)", tocEntry.startLBA);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
} else {
|
|
||||||
file.VisitTocEntry([&](auto& tocEntry) {
|
|
||||||
std::printf("%16s %10s %8s", FormatUnixTimestamp(tocEntry.creationUnixTime, DATE_FORMAT).c_str(), FormatUnit(tocEntry.size).c_str(), filename.c_str());
|
|
||||||
|
|
||||||
if constexpr(std::is_same_v<std::decay_t<decltype(tocEntry)>, estructs::PakHeader_V5::TocEntry_SectorAligned>) {
|
std::printf("\n");
|
||||||
std::printf(" (LBA %u)", tocEntry.startLBA);
|
});
|
||||||
}
|
|
||||||
|
|
||||||
std::printf("\n");
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue