Adds version option to the executable.

pull/1/head
Abhinav Sarkar 7 years ago
parent c819578006
commit 15c549a6e8
  1. 10
      app/Ringo/ArgParser.hs

@ -5,8 +5,11 @@ module Ringo.ArgParser (ProgArgs(..), parseArgs) where
import qualified Data.Text as Text
import Data.List (intercalate)
import Data.Version (showVersion)
import Options.Applicative
import Paths_ringo (version)
import Ringo.Types
data ProgArgs = ProgArgs
@ -95,9 +98,14 @@ progArgsParser =
<> action "directory"
<> help "Output directory")
versionParser :: Parser (a -> a)
versionParser = infoOption ("ringo " ++ showVersion version)
(long "version"
<> help "Print version information")
parseArgs :: IO ProgArgs
parseArgs = execParser $
info (helper <*> progArgsParser)
info (helper <*> versionParser <*> progArgsParser)
(fullDesc
<> progDesc "Transforms OLTP database schemas to OLAP database star schemas"
<> header "ringo - OLTP to OLAP schema transformer"

Loading…
Cancel
Save