From 1fefbe9159d4c08d400d188757f1f5e41742cc89 Mon Sep 17 00:00:00 2001 From: Dmitry Astapov Date: Sat, 12 Oct 2024 01:47:49 +0100 Subject: [PATCH] ;bin: fix build errors in all scripts --- bin/hledger-balance-as-budget.hs | 10 +++++----- bin/hledger-check-postable.hs | 2 +- bin/hledger-check-tagfiles.cabal.hs | 2 +- bin/hledger-check-tagfiles.hs | 2 +- bin/hledger-combine-balances.hs | 2 +- bin/hledger-move.hs | 4 ++-- bin/hledger-print-location.hs | 2 +- bin/hledger-smooth.hs | 2 +- bin/hledger-swap-dates.hs | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/bin/hledger-balance-as-budget.hs b/bin/hledger-balance-as-budget.hs index 486a91e00..08626e7df 100755 --- a/bin/hledger-balance-as-budget.hs +++ b/bin/hledger-balance-as-budget.hs @@ -10,7 +10,7 @@ -} import Data.Text.Lazy.IO as TL import System.Environment (getArgs) -import Hledger.Cli +import Hledger.Cli.Script ------------------------------------------------------------------------------ cmdmode = hledgerCommandMode @@ -34,13 +34,13 @@ main = do args <- getArgs let report1args = takeWhile (/= "--") args let report2args = drop 1 $ dropWhile (/= "--") args - (_,_,report1) <- mbReport report1args - (ropts2,j,report2) <- mbReport report2args + (opts,_,_,report1) <- mbReport report1args + (_,ropts2,j,report2) <- mbReport report2args let pastAsBudget = combineBudgetAndActual ropts2 j report1{prDates=prDates report2} report2 - TL.putStrLn $ budgetReportAsText ropts2 pastAsBudget + writeOutputLazyText opts $ budgetReportAsText ropts2 pastAsBudget where mbReport args = do opts@CliOpts{reportspec_=rspec} <- getHledgerCliOpts' cmdmode args d <- getCurrentDay (report,j) <- withJournalDo opts $ \j -> return (multiBalanceReport rspec j, j) - return (_rsReportOpts rspec,j,report) + return (opts, _rsReportOpts rspec,j,report) diff --git a/bin/hledger-check-postable.hs b/bin/hledger-check-postable.hs index 3e83e01d5..49a4fe723 100755 --- a/bin/hledger-check-postable.hs +++ b/bin/hledger-check-postable.hs @@ -19,7 +19,7 @@ import qualified Data.Text as T import Safe import System.Exit import Hledger -import Hledger.Cli +import Hledger.Cli.Script ------------------------------------------------------------------------------ cmdmode :: Mode RawOpts diff --git a/bin/hledger-check-tagfiles.cabal.hs b/bin/hledger-check-tagfiles.cabal.hs index 5ce3f0225..a17f52052 100755 --- a/bin/hledger-check-tagfiles.cabal.hs +++ b/bin/hledger-check-tagfiles.cabal.hs @@ -17,7 +17,7 @@ $ hledger check-tagfiles # compiles every time (?) import Control.Monad import qualified Data.Text as T -import Hledger.Cli +import Hledger.Cli.Script import System.Directory import System.Exit diff --git a/bin/hledger-check-tagfiles.hs b/bin/hledger-check-tagfiles.hs index a51be9717..c9994f2e8 100755 --- a/bin/hledger-check-tagfiles.hs +++ b/bin/hledger-check-tagfiles.hs @@ -18,7 +18,7 @@ $ hledger check-tagfiles # compiles if there's no compiled version import Control.Monad import qualified Data.Text as T -import Hledger.Cli +import Hledger.Cli.Script import System.Directory import System.Exit diff --git a/bin/hledger-combine-balances.hs b/bin/hledger-combine-balances.hs index 70bb922f0..23c679f8d 100755 --- a/bin/hledger-combine-balances.hs +++ b/bin/hledger-combine-balances.hs @@ -8,7 +8,7 @@ {-# OPTIONS_GHC -Wno-missing-signatures #-} import System.Environment (getArgs) -import Hledger.Cli +import Hledger.Cli.Script import qualified Data.Map as M import Data.Map.Merge.Strict import qualified Data.Text.Lazy.IO as TL diff --git a/bin/hledger-move.hs b/bin/hledger-move.hs index b961dea8b..c8467203a 100755 --- a/bin/hledger-move.hs +++ b/bin/hledger-move.hs @@ -40,7 +40,7 @@ import Text.Printf import qualified Data.Text as T import qualified Data.Text.IO as T -import Hledger.Cli +import Hledger.Cli.Script ------------------------------------------------------------------------------ cmdmode = hledgerCommandMode @@ -156,7 +156,7 @@ main = do force = boolopt "force" rawopts -- parse the AMT arg as a cost-less Amount (any provided cost is ignored) - eamt = styleAmount (journalCommodityStyles j) . amountStripCost <$> parseamount amtarg + eamt = styleAmounts (journalCommodityStyles j) . amountStripCost <$> parseamount amtarg amt = case eamt of Left err -> error' $ "could not parse " ++ show amtarg ++ " as a hledger amount\n" ++ customErrorBundlePretty err ++ "\n" ++shortusage diff --git a/bin/hledger-print-location.hs b/bin/hledger-print-location.hs index 56bd390e9..de3b65e0d 100755 --- a/bin/hledger-print-location.hs +++ b/bin/hledger-print-location.hs @@ -20,7 +20,7 @@ $ hledger print-location -f examples/sample.journal desc:eat import Data.String.QQ (s) import qualified Data.Text as T -import Hledger.Cli +import Hledger.Cli.Script ------------------------------------------------------------------------------ cmdmode = hledgerCommandMode diff --git a/bin/hledger-smooth.hs b/bin/hledger-smooth.hs index 1bf5d25ea..fcc24501d 100755 --- a/bin/hledger-smooth.hs +++ b/bin/hledger-smooth.hs @@ -24,7 +24,7 @@ import qualified Data.Text as T import Data.Time.Calendar import Safe -- import Hledger -import Hledger.Cli +import Hledger.Cli.Script ------------------------------------------------------------------------------ cmdmode = hledgerCommandMode diff --git a/bin/hledger-swap-dates.hs b/bin/hledger-swap-dates.hs index c553f09eb..03e3317f3 100755 --- a/bin/hledger-swap-dates.hs +++ b/bin/hledger-swap-dates.hs @@ -11,7 +11,7 @@ import Data.String.QQ (s) import qualified Data.Text.IO as T import Hledger -import Hledger.Cli +import Hledger.Cli.Script ------------------------------------------------------------------------------ cmdmode = hledgerCommandMode