Minor refactoring.
parent
7cec652d96
commit
57e76321a1
|
@ -21,19 +21,22 @@ data ProgArgs = ProgArgs
|
||||||
, progOutputDir :: FilePath
|
, progOutputDir :: FilePath
|
||||||
} deriving (Eq, Show)
|
} deriving (Eq, Show)
|
||||||
|
|
||||||
|
textOption :: Mod OptionFields String -> Parser Text.Text
|
||||||
|
textOption o = Text.pack <$> strOption o
|
||||||
|
|
||||||
settingsParser :: Parser Settings
|
settingsParser :: Parser Settings
|
||||||
settingsParser = let Settings {..} = defSettings
|
settingsParser = let Settings {..} = defSettings
|
||||||
in Settings
|
in Settings
|
||||||
<$> (Text.pack <$> strOption (long "dim-prefix"
|
<$> textOption (long "dim-prefix"
|
||||||
<> short 'd'
|
<> short 'd'
|
||||||
<> value (Text.unpack settingDimPrefix)
|
<> value (Text.unpack settingDimPrefix)
|
||||||
<> showDefault
|
<> showDefault
|
||||||
<> help "Prefix for dimension tables"))
|
<> help "Prefix for dimension tables")
|
||||||
<*> (Text.pack <$> strOption (long "fact-prefix"
|
<*> textOption (long "fact-prefix"
|
||||||
<> short 'f'
|
<> short 'f'
|
||||||
<> value (Text.unpack settingFactPrefix)
|
<> value (Text.unpack settingFactPrefix)
|
||||||
<> showDefault
|
<> showDefault
|
||||||
<> help "Prefix for fact tables"))
|
<> help "Prefix for fact tables")
|
||||||
<*> minorOption "fact-infix"
|
<*> minorOption "fact-infix"
|
||||||
settingFactInfix
|
settingFactInfix
|
||||||
"Infix for fact tables"
|
"Infix for fact tables"
|
||||||
|
@ -84,11 +87,11 @@ settingsParser = let Settings {..} = defSettings
|
||||||
"Suffix template for table names in SQL"
|
"Suffix template for table names in SQL"
|
||||||
where
|
where
|
||||||
minorOption longDesc defValue helpTxt =
|
minorOption longDesc defValue helpTxt =
|
||||||
Text.pack <$> strOption (long longDesc
|
textOption (long longDesc
|
||||||
<> hidden
|
<> hidden
|
||||||
<> value (Text.unpack defValue)
|
<> value (Text.unpack defValue)
|
||||||
<> showDefault
|
<> showDefault
|
||||||
<> help helpTxt)
|
<> help helpTxt)
|
||||||
|
|
||||||
progArgsParser :: Parser ProgArgs
|
progArgsParser :: Parser ProgArgs
|
||||||
progArgsParser =
|
progArgsParser =
|
||||||
|
|
Loading…
Reference in New Issue