|
@@ -1,14 +1,9 @@
|
1
|
1
|
{-# LANGUAGE OverloadedStrings #-}
|
2
|
2
|
{-# LANGUAGE RecordWildCards #-}
|
3
|
|
-{-# LANGUAGE TemplateHaskell #-}
|
4
|
3
|
|
5
|
4
|
module Ringo.ArgParser (ProgArgs(..), parseArgs) where
|
6
|
5
|
|
7
|
6
|
import qualified Data.Text as Text
|
8
|
|
-import qualified Distribution.Package as P
|
9
|
|
-import qualified Distribution.PackageDescription as P
|
10
|
|
-import qualified Distribution.CurrentPackageDescription as P
|
11
|
|
-import qualified Distribution.Text as DText
|
12
|
7
|
|
13
|
8
|
import Data.List (intercalate)
|
14
|
9
|
import Data.Monoid ((<>))
|
|
@@ -109,9 +104,10 @@ progArgsParser =
|
109
|
104
|
versionParser :: String -> Parser (a -> a)
|
110
|
105
|
versionParser progName = infoOption (progName ++ " " ++ version)
|
111
|
106
|
(long "version"
|
|
107
|
+ <> short 'v'
|
112
|
108
|
<> help "Print version information")
|
113
|
109
|
where
|
114
|
|
- version = $(P.getField (DText.display . P.pkgVersion . P.package))
|
|
110
|
+ version = "0.1.0"
|
115
|
111
|
|
116
|
112
|
parseArgs :: IO ProgArgs
|
117
|
113
|
parseArgs = do
|
|
@@ -119,6 +115,6 @@ parseArgs = do
|
119
|
115
|
execParser $
|
120
|
116
|
info (helper <*> versionParser progName <*> progArgsParser)
|
121
|
117
|
(fullDesc
|
122
|
|
- <> progDesc $(P.getField P.description)
|
123
|
|
- <> header (progName ++ " - " ++ $(P.getField P.synopsis))
|
124
|
|
- <> footer ("© " ++ $(P.getField P.copyright) ++ ". " ++ $(P.getField P.homepage)))
|
|
118
|
+ <> progDesc "Tool to transform Postgres OLTP schemas to OLAP star schemas automatically"
|
|
119
|
+ <> header (progName ++ " - OLTP to OLAP schema transformer for Postgres")
|
|
120
|
+ <> footer "© 2015-2017 Quintype Inc, Nilenso Software LLP, Abhinav Sarkar. http://github.com/abhin4v/ringo")
|