From 57efcfb79a7195ffa5c2b27c364d87715f826287 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Sat, 1 Feb 2025 13:54:57 -1000 Subject: [PATCH] ;bin: script-example: cleanup --- bin/hledger-script-example.hs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/bin/hledger-script-example.hs b/bin/hledger-script-example.hs index fce72642c..938870dcf 100755 --- a/bin/hledger-script-example.hs +++ b/bin/hledger-script-example.hs @@ -62,13 +62,16 @@ cmdmode = hledgerCommandMode (unlines [] [generalflagsgroup1] [] ([], Just $ argsFlag "[ARGS]") -- Most scripts have three steps: --- 1. process command line options/arguments --- 2. read the journal file --- 3. do something with it. main = do + + -- 1. process command line options/arguments opts@CliOpts{reportspec_=rspec} <- getHledgerCliOpts cmdmode + + -- 2. read the journal file withJournalDo opts $ \j -> do - putStrLn "hello" + + -- 3. do something with it. + putStrLn $ (show $ length $ jtxns j) <> " transactions in " <> (show $ journalFilePath j)