From 1bed6941dc11065d2bb9b4101f0d2ecd0a03674b Mon Sep 17 00:00:00 2001 From: Dmitriy Kovalenko Date: Sun, 25 Aug 2024 13:10:31 +0200 Subject: [PATCH] Use version from dune build info --- bin/ODiffBin.ml | 7 ++++++- bin/dune | 2 +- dune-project | 1 + odiff.opam | 1 + package.json | 2 +- 5 files changed, 10 insertions(+), 3 deletions(-) diff --git a/bin/ODiffBin.ml b/bin/ODiffBin.ml index c46c98dc..c364346c 100644 --- a/bin/ODiffBin.ml +++ b/bin/ODiffBin.ml @@ -78,6 +78,11 @@ let cmd = $ diffColor $ parsableOutput $ antialiasing $ ignoreRegions $ diffLines $ disableGcOptimizations +let version = + match Build_info.V1.version () with + | None -> "dev" + | Some v -> Build_info.V1.Version.to_string v + let info = let man = [ @@ -86,7 +91,7 @@ let info = `P "Supported image types: .png, .jpg, .jpeg, .tiff"; ] in - Cmd.info "odiff" ~version:"3.0.1" ~doc:"Find difference between 2 images." + Cmd.info "odiff" ~version ~doc:"Find difference between 2 images." ~exits: [ Cmd.Exit.info 0 ~doc:"on image match"; diff --git a/bin/dune b/bin/dune index 8d5e06b7..5c8dfeec 100644 --- a/bin/dune +++ b/bin/dune @@ -4,7 +4,7 @@ (package odiff) (flags (:standard -w -27)) - (libraries odiff-core odiff-io cmdliner)) + (libraries odiff-core odiff-io cmdliner dune-build-info)) (env (dev diff --git a/dune-project b/dune-project index b8a189e9..8ca2e570 100644 --- a/dune-project +++ b/dune-project @@ -19,6 +19,7 @@ (package (name odiff) + (version 3.1.0) (synopsis "CLI for comparing images pixel-by-pixel") (depends odiff-core diff --git a/odiff.opam b/odiff.opam index 2148379f..9107efc7 100644 --- a/odiff.opam +++ b/odiff.opam @@ -1,5 +1,6 @@ # This file is generated by dune, edit dune-project instead opam-version: "2.0" +version: "3.1.0" synopsis: "CLI for comparing images pixel-by-pixel" maintainer: ["https://dmtrkovalenko.dev" "dmtr.kovalenko@outlook.com"] authors: ["Dmitriy Kovalenko"] diff --git a/package.json b/package.json index c6d6f35f..333bc312 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "odiff-bin", - "version": "3.0.1", + "version": "3.1.0", "author": "Dmitriy Kovalenko ", "license": "MIT", "description": "The fastest image difference tool in the world",