summaryrefslogtreecommitdiff
path: root/src/Toml/Checker.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Toml/Checker.hs')
-rw-r--r--src/Toml/Checker.hs9
1 files changed, 5 insertions, 4 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