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