@@ -96,6 +96,7 @@ int main(int argc, char** argv) {
96
96
const auto inputs = args.positional ();
97
97
const auto license = args.get <std::string>(" license" );
98
98
const bool asksForHelp = !!args.get <bool >(" h" );
99
+ const bool quiet = !!args.get <bool >(" q" );
99
100
const bool hasOutput = output.has_value ();
100
101
const bool hasExactlyOneInput = inputs.size () == 1 ;
101
102
@@ -107,6 +108,7 @@ Usage: {} input.json [-h] -o output.bin
107
108
-basedir path optional: base directory for the input files.
108
109
-license file optional: use this license file.
109
110
-threads count optional: number of threads to use for compression.
111
+ -q optional: only print errors.
110
112
-h displays this help information and exit.
111
113
)" ,
112
114
argv[0 ]);
@@ -199,7 +201,9 @@ Usage: {} input.json [-h] -o output.bin
199
201
fmt::print (" Too many files specified ({}), max allowed is {}\n " , filesCount, c_maximumSectorCount);
200
202
return -1 ;
201
203
}
202
- fmt::print (" Index size: {}\n " , indexSectorsCount * 2048 );
204
+ if (!quiet) {
205
+ fmt::print (" Index size: {}\n " , indexSectorsCount * 2048 );
206
+ }
203
207
204
208
PCSX::PS1Packer::Options options;
205
209
options.booty = false ;
@@ -219,8 +223,10 @@ Usage: {} input.json [-h] -o output.bin
219
223
fmt::print (" Executable size is not a multiple of 2048\n " );
220
224
return -1 ;
221
225
}
222
- fmt::print (" Executable size: {}\n " , compressedExecutable->size ());
223
- fmt::print (" Executable location: {}\n " , 23 + indexSectorsCount);
226
+ if (!quiet) {
227
+ fmt::print (" Executable size: {}\n " , compressedExecutable->size ());
228
+ fmt::print (" Executable location: {}\n " , 23 + indexSectorsCount);
229
+ }
224
230
225
231
const unsigned executableSectorsCount = compressedExecutable->size () / 2048 ;
226
232
unsigned currentSector = 23 + indexSectorsCount;
@@ -356,11 +362,13 @@ Usage: {} input.json [-h] -o output.bin
356
362
return -1 ;
357
363
}
358
364
IndexEntry* entry = &indexEntryData[workUnitIndex];
359
- fmt::print (" Processed file: {}\n " , workUnit.fileInfo [" path" ].get <std::string>());
360
- fmt::print (" Original size: {}\n " , entry->getDecompSize ());
361
- fmt::print (" Compressed size: {}\n " , entry->getCompressedSize () * 2048 );
362
- fmt::print (" Compression method: {}\n " , static_cast <uint32_t >(entry->getCompressionMethod ()));
363
- fmt::print (" Sector offset: {}\n " , currentSector);
365
+ if (!quiet) {
366
+ fmt::print (" Processed file: {}\n " , workUnit.fileInfo [" path" ].get <std::string>());
367
+ fmt::print (" Original size: {}\n " , entry->getDecompSize ());
368
+ fmt::print (" Compressed size: {}\n " , entry->getCompressedSize () * 2048 );
369
+ fmt::print (" Compression method: {}\n " , static_cast <uint32_t >(entry->getCompressionMethod ()));
370
+ fmt::print (" Sector offset: {}\n " , currentSector);
371
+ }
364
372
entry->setSectorOffset (currentSector);
365
373
unsigned sectorCount = entry->getCompressedSize ();
366
374
for (unsigned sector = 0 ; sector < sectorCount; sector++) {
@@ -370,7 +378,9 @@ Usage: {} input.json [-h] -o output.bin
370
378
}
371
379
}
372
380
373
- fmt::print (" Processed {} files.\n " , filesCount);
381
+ if (!quiet) {
382
+ fmt::print (" Processed {} files.\n " , filesCount);
383
+ }
374
384
375
385
uint8_t empty[2048 ] = {0 };
376
386
for (unsigned i = 0 ; i < 150 ; i++) {
0 commit comments