From 543844bedfc9aa8ba2c0c86ea050690bc59203a9 Mon Sep 17 00:00:00 2001 From: Serpent7776 Date: Sat, 12 Oct 2024 17:02:57 +0200 Subject: [PATCH] Make the diffPath optional --- bin/Main.ml | 2 +- bin/ODiffBin.ml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/Main.ml b/bin/Main.ml index b1896d88..afe820f4 100644 --- a/bin/Main.ml +++ b/bin/Main.ml @@ -60,7 +60,7 @@ let main img1Path img2Path diffPath threshold outputDiffMask failOnLayoutChange -> { exitCode = 0; diff = Some diffOutput } | Pixel (diffOutput, diffCount, diffPercentage, _) -> - IO1.saveImage diffOutput diffPath; + diffPath |> Option.iter (IO1.saveImage diffOutput); { exitCode = 22; diff = Some diffOutput } in IO1.freeImage img1; diff --git a/bin/ODiffBin.ml b/bin/ODiffBin.ml index c364346c..7c18bfcd 100644 --- a/bin/ODiffBin.ml +++ b/bin/ODiffBin.ml @@ -3,8 +3,8 @@ open Term open Arg let diffPath = - value & pos 2 string "" - & info [] ~docv:"DIFF" ~doc:"Diff output path (.png only)" + value & pos 2 (some string) None + & info [] ~docv:"DIFF" ~doc:"Optional Diff output path (.png only)" let base = value & pos 0 file "" & info [] ~docv:"BASE" ~doc:"Path to base image"