eupak: Make it a error to specify --sector-aligned outside of -V jedistarfighter
Should make it less error prone. I mean, I could probably have just made this a warning but it's better to make it clear it doesn't do anything/work.
This commit is contained in:
parent
05d4b706b4
commit
447b134118
2 changed files with 9 additions and 1 deletions
|
@ -41,7 +41,7 @@ namespace europa::io {
|
||||||
/// Write archive to the given output stream.
|
/// Write archive to the given output stream.
|
||||||
/// [vec] is all files which should be packaged
|
/// [vec] is all files which should be packaged
|
||||||
/// [sink] is a implementation of PakProgressReportsSink which should get events (TODO: Make this optional)
|
/// [sink] is a implementation of PakProgressReportsSink which should get events (TODO: Make this optional)
|
||||||
/// [sectorAlignment] controls sector alignment
|
/// [sectorAlignment] controls sector alignment. It is ignored unless the package's version is [structs::PakVersion::Ver5].
|
||||||
void Write(std::ostream& os, std::vector<FlattenedType>&& vec, PakProgressReportSink& sink, SectorAlignment sectorAlignment = SectorAlignment::DoNotAlign);
|
void Write(std::ostream& os, std::vector<FlattenedType>&& vec, PakProgressReportSink& sink, SectorAlignment sectorAlignment = SectorAlignment::DoNotAlign);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -12,6 +12,8 @@
|
||||||
#include <tasks/ExtractTask.hpp>
|
#include <tasks/ExtractTask.hpp>
|
||||||
#include <tasks/InfoTask.hpp>
|
#include <tasks/InfoTask.hpp>
|
||||||
|
|
||||||
|
#include "europa/structs/Pak.hpp"
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
// FIXME: At some point we should just have task classes register their arguments
|
// FIXME: At some point we should just have task classes register their arguments
|
||||||
// and then they will deal with all that themselves. The only thing we will do here
|
// and then they will deal with all that themselves. The only thing we will do here
|
||||||
|
@ -162,6 +164,12 @@ int main(int argc, char** argv) {
|
||||||
|
|
||||||
args.sectorAligned = createParser.get<bool>("--sector-aligned");
|
args.sectorAligned = createParser.get<bool>("--sector-aligned");
|
||||||
|
|
||||||
|
if(args.sectorAligned && args.pakVersion != eupak::estructs::PakVersion::Ver5) {
|
||||||
|
std::cout << "Error: --sector-aligned is only valid for creating a package with \"-V jedistarfighter\".\n"
|
||||||
|
<< createParser;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
if(!eupak::fs::is_directory(args.inputDirectory)) {
|
if(!eupak::fs::is_directory(args.inputDirectory)) {
|
||||||
std::cout << "Error: Provided input isn't a directory\n"
|
std::cout << "Error: Provided input isn't a directory\n"
|
||||||
<< createParser;
|
<< createParser;
|
||||||
|
|
Loading…
Reference in a new issue