summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvmchale <>2017-11-09 02:49:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2017-11-09 02:49:00 (GMT)
commit1299105ed0e5648cef4c6ee1309ae52afa30177a (patch)
tree9b81b76f82e129b6ce31ff2ed7445bd315b867ed
parentdbd2591c7707a6ad5ceaaf809540819e1c8f3861 (diff)
version 0.1.0.180.1.0.18
-rw-r--r--src/Toml/Checker.hs9
-rw-r--r--tomlcheck.cabal2
2 files changed, 6 insertions, 5 deletions
diff --git a/src/Toml/Checker.hs b/src/Toml/Checker.hs
index 555d297..55b0b6b 100644
--- a/src/Toml/Checker.hs
+++ b/src/Toml/Checker.hs
@@ -7,6 +7,7 @@ module Toml.Checker
( exec
) where
+import Control.Monad (zipWithM)
import qualified Data.Text.IO as TIO
import GHC.Generics (Generic)
import Options.Generic
@@ -14,7 +15,7 @@ import System.Exit (ExitCode (..), exitWith)
import Text.Megaparsec (parseErrorPretty)
import Text.Toml (parseTomlDoc)
-newtype Program = Program { file :: FilePath <?> "Path to file to be checked." }
+newtype Program = Program { file :: [FilePath] <?> "Path to file to be checked." }
deriving (Generic)
programModifiers :: Modifiers
@@ -26,9 +27,9 @@ instance ParseRecord Program where
exec :: IO ()
exec = do
x <- getRecord "Command-line wrapper around htoml"
- let path = unHelpful $ file x
- contents <- TIO.readFile path
- case parseTomlDoc path contents of
+ let paths = unHelpful $ file x
+ contents <- traverse TIO.readFile paths
+ case zipWithM parseTomlDoc paths contents of
Right _ -> pure ()
Left e -> do
putStrLn $ parseErrorPretty e
diff --git a/tomlcheck.cabal b/tomlcheck.cabal
index 73a8c1e..8c5b39a 100644
--- a/tomlcheck.cabal
+++ b/tomlcheck.cabal
@@ -1,5 +1,5 @@
name: tomlcheck
-version: 0.1.0.17
+version: 0.1.0.18
synopsis: Command-line tool to check syntax of TOML files
description: This is a command-line wrapper around htoml-megaparsec.
It is intended to be used as a syntax checker that can be