mirror of
https://github.com/snoyberg/keter.git
synced 2025-01-05 21:36:40 +03:00
27 lines
794 B
Haskell
27 lines
794 B
Haskell
{-# LANGUAGE NoImplicitPrelude #-}
|
|
{-# LANGUAGE OverloadedStrings #-}
|
|
import Prelude (error, (++), ($), IO, putStrLn)
|
|
import System.Environment (getArgs, getProgName)
|
|
import Keter.Main (keter)
|
|
import Paths_keter (version)
|
|
import Data.Version (showVersion)
|
|
import qualified Keter.Plugin.Postgres as Postgres
|
|
import Data.Default (def)
|
|
import System.FilePath ((</>))
|
|
|
|
main :: IO ()
|
|
main = do
|
|
args <- getArgs
|
|
case args of
|
|
["--version"] -> putStrLn $ "keter version: " ++ showVersion version
|
|
["--help"] -> printUsage
|
|
[dir] -> keter
|
|
dir
|
|
[\configDir -> Postgres.load def $ configDir </> "etc" </> "postgres.yaml"]
|
|
_ -> printUsage
|
|
|
|
printUsage :: IO ()
|
|
printUsage = do
|
|
pn <- getProgName
|
|
error $ "Usage: " ++ pn ++ " <config file>"
|