aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md4
-rw-r--r--src/Main.hs5
2 files changed, 6 insertions, 3 deletions
diff --git a/README.md b/README.md
index 4174d66..ace4c08 100644
--- a/README.md
+++ b/README.md
@@ -26,8 +26,8 @@ Usage
=====
Note that when neither `--keep` nor `--delete` option is given, the utility
-prints all intervals with all days in them _to standard error_. In production
-you will need to specify `--keep` or `--delete` explicitly.
+prints all intervals with all days _to standard error_ and exits with non-zero
+code. In production you will need to specify `--keep` or `--delete` explicitly.
```
Usage: frotate ([-k|--keep] | [-d|--delete]) [-b|--base BASE] DAY...
diff --git a/src/Main.hs b/src/Main.hs
index 0f66daa..09aeb99 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -2,6 +2,7 @@ module Main
( main
) where
+import System.Exit (exitFailure)
import System.IO (hPutStrLn, stderr)
import Data.Time.Calendar (Day)
@@ -64,4 +65,6 @@ main = do
putStrLn $ unwords . map show . concatMap (take 1 . reverse) $ groups
Just Delete ->
putStrLn $ unwords . map show . concatMap (drop 1 . reverse) $ groups
- Nothing -> mapM_ (hPutStrLn stderr . unwords . map show . reverse) groups
+ Nothing -> do
+ mapM_ (hPutStrLn stderr . unwords . map show . reverse) groups
+ exitFailure