diff options
author | Yann Herklotz <git@yannherklotz.com> | 2023-05-28 15:41:55 +0100 |
---|---|---|
committer | Yann Herklotz <git@yannherklotz.com> | 2023-05-28 15:41:55 +0100 |
commit | 846c9411e6f7d91a36527e798505fd3b4541adaa (patch) | |
tree | 6b557fda1f2ea42cfb2706b721223e8a9f437014 | |
parent | d29b8cef5a13c8d351b0c8d6f88583941f404aa8 (diff) | |
download | zk-visual-846c9411e6f7d91a36527e798505fd3b4541adaa.tar.gz zk-visual-846c9411e6f7d91a36527e798505fd3b4541adaa.zip |
Add better version string
-rw-r--r-- | org-zk.cabal | 4 | ||||
-rw-r--r-- | src/Main.hs | 10 |
2 files changed, 8 insertions, 6 deletions
diff --git a/org-zk.cabal b/org-zk.cabal index 125fd6e..0cad8f0 100644 --- a/org-zk.cabal +++ b/org-zk.cabal @@ -1,9 +1,9 @@ cabal-version: 2.4 name: org-zk version: 0.1.0.0 -license: AGPL-3.0-only +license: GPL-3.0-only copyright: 2021-2023 Yann Herklotz -maintainer: yann@ymhg.org +maintainer: git@yannherklotz.com author: Yann Herklotz category: Web diff --git a/src/Main.hs b/src/Main.hs index 04f6c0a..47dc859 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -32,6 +32,8 @@ module Main where import Control.Exception (ioError) import Control.Logging import qualified Data.Text as T +import Data.Version (showVersion) +import Paths_org_zk (version) import System.Console.GetOpt import System.IO.Error (userError) import Zettel @@ -291,11 +293,11 @@ options = "Show current version" ] -version :: String -version = "org-zk 0.1.0 - (C) 2023 Yann Herklotz" +versionStr :: String +versionStr = "org-zk " <> showVersion version <> " - (C) 2023 Yann Herklotz" headerOpts :: String -headerOpts = version <> "\n\nUsage: org-zk [OPTION...] [FILE...]\n\n[OPTION]" +headerOpts = versionStr <> "\n\nUsage: org-zk [OPTION...] [FILE...]\n\n[OPTION]" compilerOpts :: [String] -> IO (Options, [String]) compilerOpts argv = @@ -319,7 +321,7 @@ main = withStderrLogging $ do exitSuccess when (optShowVersion zkOpts) $ do - putStrLn version + putStrLn versionStr exitSuccess graph <- parseZettelKasten (zip [1 ..] fl) (optOrgBibliography zkOpts) |