change verb when dry-running

master
Michele Guerini Rocco 2021-09-06 00:42:09 +02:00
parent cfe3ac83eb
commit 6c3e5a5c4e
Signed by: rnhmjoj
GPG Key ID: BFBAF4C975F76450
1 changed files with 5 additions and 1 deletions

View File

@ -142,9 +142,13 @@ runAction settings name x = do
printFailed msg = T.putStrLn ("- " <> name <> " cleaning failed:\n " <> msg)
printResult (n, bad)
| n > 0 = do
T.putStrLn ("- " <> name <> ": deleted " <> T.pack (show n) <> " entries for:")
T.putStrLn ("- " <> name <> ": " <> verb <>
" " <> T.pack (show n) <> " entries for:")
T.putStrLn (T.unlines $ map (" * " <>) bad)
| otherwise = T.putStrLn ("- " <> name <> ": nothing to delete")
verb = if (dryRun . options $ settings)
then "would delete"
else "deleted"
-- * Cleaning actions