From fcb4a39089c6f48a2f61abd04c418d2c8197a05c Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Sat, 17 Sep 2011 04:19:26 +0000 Subject: [PATCH] when running addons with --debug, show the command line --- hledger/Hledger/Cli/Main.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hledger/Hledger/Cli/Main.hs b/hledger/Hledger/Cli/Main.hs index b33b7b0b3..130dfe10e 100644 --- a/hledger/Hledger/Cli/Main.hs +++ b/hledger/Hledger/Cli/Main.hs @@ -80,7 +80,9 @@ main = do | any (cmd `isPrefixOf`) ["postings","register"] = showModeHelpOr postingsmode $ withJournalDo opts register | any (cmd `isPrefixOf`) ["activity","histogram"] = showModeHelpOr activitymode $ withJournalDo opts histogram | cmd `isPrefixOf` "stats" = showModeHelpOr statsmode $ withJournalDo opts stats - | not (null matchedaddon) = system shellcmd >>= exitWith + | not (null matchedaddon) = do + when (debug_ opts) $ printf "running %s\n" shellcmd + system shellcmd >>= exitWith | otherwise = optserror ("command "++cmd++" is not recognized") >> exitFailure where mainmode' = mainmode addons