diff --git a/ips.cabal b/ips.cabal index 7972c27..4b8ba1f 100644 --- a/ips.cabal +++ b/ips.cabal @@ -12,7 +12,7 @@ bug-reports: https://git.rhiannon.website/rhi/ips/issues source-repository head type: git - location: https://git.rhiannon.website/rhi/ips.git + location: git://git.rhiannon.website/rhi/ips.git common deps default-language: Haskell2010 @@ -24,11 +24,11 @@ common deps NamedFieldPuns, OverloadedStrings build-depends: - base >= 4.14.1.0 && < 4.22, - bytestring >= 0.11.1.0 && < 0.13, - vector >= 0.12.2.0 && < 0.14, - attoparsec >= 0.13.2.5 && < 0.15, - primitive >= 0.7.1.0 && < 0.10 + base ^>= 4.14.1.0, + bytestring ^>= 0.11.1.0, + vector ^>= 0.12.2.0, + attoparsec >= 0.13.2.5 && < 0.15, + primitive ^>= 0.7.1.0 ghc-options: -Wall library diff --git a/main/ips.hs b/main/ips.hs index 71925ff..2236ca6 100644 --- a/main/ips.hs +++ b/main/ips.hs @@ -2,9 +2,8 @@ module Main (main) where import IPS (Bytes, makeBytes) import qualified IPS -import System.Environment (getArgs) -import System.Exit (exitFailure) -import System.IO (hPutBuf, withFile, IOMode(WriteMode)) +import System.Environment +import System.IO import qualified Data.ByteString as ByteString import qualified Data.Vector.Storable as Vector @@ -14,11 +13,9 @@ main = do case args of [inf, ipsf, outf] -> do buf <- readBytes inf - ips <- either error id <$> IPS.parseFile ipsf + ips <- either error id <$> IPS.read ipsf writeBytes outf $ IPS.apply ips buf - _ -> do - putStrLn "usage: ips " - exitFailure + _ -> error "usage: $0 " readBytes :: FilePath -> IO Bytes readBytes f = makeBytes <$> ByteString.readFile f