From 9e9788f88bd4f70e09a74510659b64d7a838a10c Mon Sep 17 00:00:00 2001 From: rhiannon morris Date: Fri, 4 Apr 2025 23:45:59 +0200 Subject: [PATCH 1/3] haha what --- main/ips.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/ips.hs b/main/ips.hs index 2236ca6..27bd329 100644 --- a/main/ips.hs +++ b/main/ips.hs @@ -13,7 +13,7 @@ main = do case args of [inf, ipsf, outf] -> do buf <- readBytes inf - ips <- either error id <$> IPS.read ipsf + ips <- either error id <$> IPS.parseFile ipsf writeBytes outf $ IPS.apply ips buf _ -> error "usage: $0 " From 6756c1f186505c375f512ef2d7ab24e386db2206 Mon Sep 17 00:00:00 2001 From: rhiannon morris Date: Fri, 4 Apr 2025 23:46:10 +0200 Subject: [PATCH 2/3] make error slightly nicer --- main/ips.hs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/main/ips.hs b/main/ips.hs index 27bd329..71925ff 100644 --- a/main/ips.hs +++ b/main/ips.hs @@ -2,8 +2,9 @@ module Main (main) where import IPS (Bytes, makeBytes) import qualified IPS -import System.Environment -import System.IO +import System.Environment (getArgs) +import System.Exit (exitFailure) +import System.IO (hPutBuf, withFile, IOMode(WriteMode)) import qualified Data.ByteString as ByteString import qualified Data.Vector.Storable as Vector @@ -15,7 +16,9 @@ main = do buf <- readBytes inf ips <- either error id <$> IPS.parseFile ipsf writeBytes outf $ IPS.apply ips buf - _ -> error "usage: $0 " + _ -> do + putStrLn "usage: ips " + exitFailure readBytes :: FilePath -> IO Bytes readBytes f = makeBytes <$> ByteString.readFile f From 6a8c937d241156ab3b6ac684c2dc5e0fd9648dde Mon Sep 17 00:00:00 2001 From: rhiannon morris Date: Fri, 4 Apr 2025 23:46:19 +0200 Subject: [PATCH 3/3] dependency bumps --- ips.cabal | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ips.cabal b/ips.cabal index 4b8ba1f..7972c27 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: git://git.rhiannon.website/rhi/ips.git + location: https://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, - bytestring ^>= 0.11.1.0, - vector ^>= 0.12.2.0, - attoparsec >= 0.13.2.5 && < 0.15, - primitive ^>= 0.7.1.0 + 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 ghc-options: -Wall library