From f4d81377af4ddb6d0ed5f4491e459e9dc6b5bbf2 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Sat, 20 Feb 2021 14:16:33 -0800 Subject: [PATCH] print --match: show --match's argument in debug output If you forget that the argument is required by the --match option, and not the command as a whole - eg if instead of hledger print --match somebank -x you write: hledger print --match -x somebank that gets quietly parsed as: hledger print --match="-x" which is not great. Adding --debug now at least gives some insight: hledger print --match -x somebank --debug finding best match for description: "-x" similar transactions: ... --- hledger/Hledger/Cli/Commands/Print.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hledger/Hledger/Cli/Commands/Print.hs b/hledger/Hledger/Cli/Commands/Print.hs index b55347384..58248b293 100644 --- a/hledger/Hledger/Cli/Commands/Print.hs +++ b/hledger/Hledger/Cli/Commands/Print.hs @@ -62,7 +62,7 @@ print' opts j = do let j' = journalMapPostingAmounts amountSetFullPrecision j case maybestringopt "match" $ rawopts_ opts of Nothing -> printEntries opts j' - Just desc -> printMatch opts j' $ T.pack desc + Just desc -> printMatch opts j' $ T.pack $ dbg1 "finding best match for description" desc printEntries :: CliOpts -> Journal -> IO () printEntries opts@CliOpts{reportspec_=rspec} j =