diff --git a/cabal-prettify.cabal b/cabal-prettify.cabal index 9cc51fe..dfcffdc 100644 --- a/cabal-prettify.cabal +++ b/cabal-prettify.cabal @@ -63,6 +63,7 @@ executable cabal-prettify import: commons hs-source-dirs: executables/cabal-prettify main-is: Main.hs + other-modules: PackageInfo_cabal_prettify build-depends: , base , base-unicode-symbols diff --git a/executables/cabal-prettify/Main.hs b/executables/cabal-prettify/Main.hs index 9c703d5..63276ae 100644 --- a/executables/cabal-prettify/Main.hs +++ b/executables/cabal-prettify/Main.hs @@ -10,12 +10,14 @@ import Control.Monad.Trans.Writer import Data.Bifunctor import Data.ByteString qualified as ByteArray import Data.Maybe +import Data.Version import Distribution.Simple.Utils qualified as Cabal import Distribution.Verbosity qualified as Cabal import GHC.Generics (Generic) import Generics.Deriving.Monoid import Generics.Deriving.Semigroup import Options.Applicative +import PackageInfo_cabal_prettify qualified as PackageInfo import Path import Path.IO import System.Exit @@ -30,7 +32,10 @@ instance Exception CabalPrettifyException main ∷ IO () main = do root ← getCurrentDir - command ← execParser (info (parseCommand root <**> helper) (fullDesc <> progDesc "Prettify your Cabal package configuration files!")) + command ← execParser do + info + do parseCommand root <**> helper <**> simpleVersioner (showVersion PackageInfo.version) + do fullDesc <> progDesc "Prettify your Cabal package configuration files!" run root command data Command = Command