diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2017-08-03 21:26:33 +0300 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2017-08-03 21:32:06 +0300 |
commit | b1a599a6df4100ca1da6e778d1fdade3efe01451 (patch) | |
tree | 88e4e16c6f242cb92473d899cdfa0f10c84ddd4e /src/Main.hs | |
parent | 1c621db4b5b0d78ae6b2f79c71122c6cca2a0815 (diff) | |
download | ire-master.tar.gz |
Diffstat (limited to 'src/Main.hs')
-rw-r--r-- | src/Main.hs | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/Main.hs b/src/Main.hs index 5070d8d..6527584 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -1,14 +1,15 @@ {-# LANGUAGE QuasiQuotes #-} -module Main ( - main -) where + +module Main + ( main + ) where import Data.Maybe (fromJust) import Data.Version (showVersion) import Paths_ire (getDataDir, version) -- from cabal +import qualified System.Console.Docopt.NoTH as O import System.Environment (getArgs) import Text.InterpolatedString.Perl6 (qc) -import qualified System.Console.Docopt.NoTH as O import IRE.Server (server) @@ -16,8 +17,10 @@ usage :: IO String usage = do dataDir <- getDataDir return $ - "IRE " ++ showVersion version ++ - " - Watching you!" ++ [qc| + "IRE " ++ + showVersion version ++ + " - Watching you!" ++ + [qc| Usage: ire [options] @@ -39,9 +42,8 @@ main = do doco <- O.parseUsageOrExit =<< usage args <- O.parseArgsOrExit doco =<< getArgs if args `O.isPresent` O.longOption "help" - then putStrLn $ O.usage doco - else do - let configFile = fromJust . O.getArg args $ O.longOption "config" - rootDir = fromJust . O.getArg args $ O.longOption "rootdir" - server rootDir configFile - + then putStrLn $ O.usage doco + else do + let configFile = fromJust . O.getArg args $ O.longOption "config" + rootDir = fromJust . O.getArg args $ O.longOption "rootdir" + server rootDir configFile |