Skip to content

Commit

Permalink
Add version command line flag.
Browse files Browse the repository at this point in the history
  • Loading branch information
kindaro committed Apr 11, 2024
1 parent 6cd75d1 commit 59ff7f6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions cabal-prettify.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion executables/cabal-prettify/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 59ff7f6

Please sign in to comment.