From a39b2bd253f23ec365e964236c23fc09b716edbe Mon Sep 17 00:00:00 2001 From: mgiuntoni Date: Sun, 28 Jun 2026 01:04:07 +0200 Subject: [PATCH] Fix ambiguous -P/-p option conflict: rename par-archive flag to -x McMaster.Extensions.CommandLineUtils treats short option names case-insensitively, so -P (ParArchive) collided with -p (IsParallel), crashing on startup with InvalidOperationException. Renamed -P|--par-archive to -x|--par-archive. Co-Authored-By: Claude Sonnet 4.6 --- Program.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Program.cs b/Program.cs index 481cddd..41d43e8 100644 --- a/Program.cs +++ b/Program.cs @@ -64,7 +64,14 @@ namespace ComicCompressor // In core changed color of percent save to white //string progVersion = "Version 3.0.1 - (23/01/2025)"; - // In core changed color of percent save to white + // Updated NuGet packages (SharpCompress 0.49, Magick.NET 14.14, System.Drawing.Common 10.0, + // itext 9.6, Imazen.WebP 11.0, McMaster 5.1). SharpCompress 0.49 API migration. + // Pre-sized MemoryStream allocations with entry.Size (reduced GC pressure). + // Fixed missing OnExecuteAsync (CLI was throwing InvalidOperationException on launch). + // Added -w|--new-webp flag (Imageflow encoder; benchmarked slower than Imazen.WebP). + // Added -x|--par-archive: parallel image compression within archive (~4-5x speedup). + // Batched 3-phase: sequential read → Parallel.For (ProcessorCount/2) → sequential write. + // GUI: added Par.Archive checkbox (default ON for COMIX/COMIX+PDF modes). string progVersion = "Version 3.1.0 - (27/06/2027)"; public static int Main(string[] args) => CommandLineApplication.Execute(args); @@ -108,7 +115,7 @@ namespace ComicCompressor [Option("-w|--new-webp", Description = "Use Imageflow encoder (faster JPEG→WebP transcoding, no full pixel decode)")] public bool NewWebp { get; } = false; - [Option("-P|--par-archive", Description = "Parallel image compression within each archive (~4-5x faster, uses half the CPUs)")] + [Option("-x|--par-archive", Description = "Parallel image compression within each archive (~4-5x faster, uses half the CPUs)")] public bool ParArchive { get; } = false; #endregion