Skip to content

Commit

Permalink
Make the diffPath optional
Browse files Browse the repository at this point in the history
  • Loading branch information
serpent7776 committed Oct 12, 2024
1 parent c58c505 commit fe427a5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion bin/Main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ let main img1Path img2Path diffPath threshold outputDiffMask failOnLayoutChange
->
{ exitCode = 0; diff = Some diffOutput }
| Pixel (diffOutput, diffCount, diffPercentage, _) ->
IO1.saveImage diffOutput diffPath;
if Option.is_some diffPath then
IO1.saveImage diffOutput @@ Option.get diffPath;
{ exitCode = 22; diff = Some diffOutput }
in
IO1.freeImage img1;
Expand Down
4 changes: 2 additions & 2 deletions bin/ODiffBin.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit fe427a5

Please sign in to comment.