when running addons with --debug, show the command line

This commit is contained in:
Simon Michael 2011-09-17 04:19:26 +00:00
parent 5670dabf1b
commit fcb4a39089

View File

@ -80,7 +80,9 @@ main = do
| any (cmd `isPrefixOf`) ["postings","register"] = showModeHelpOr postingsmode $ withJournalDo opts register | any (cmd `isPrefixOf`) ["postings","register"] = showModeHelpOr postingsmode $ withJournalDo opts register
| any (cmd `isPrefixOf`) ["activity","histogram"] = showModeHelpOr activitymode $ withJournalDo opts histogram | any (cmd `isPrefixOf`) ["activity","histogram"] = showModeHelpOr activitymode $ withJournalDo opts histogram
| cmd `isPrefixOf` "stats" = showModeHelpOr statsmode $ withJournalDo opts stats | 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 | otherwise = optserror ("command "++cmd++" is not recognized") >> exitFailure
where where
mainmode' = mainmode addons mainmode' = mainmode addons