summaryrefslogtreecommitdiff
path: root/app/Main.hs
diff options
context:
space:
mode:
Diffstat (limited to 'app/Main.hs')
-rw-r--r--app/Main.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/Main.hs b/app/Main.hs
index 2cff22a..e44926d 100644
--- a/app/Main.hs
+++ b/app/Main.hs
@@ -11,11 +11,12 @@ import Data.List (intercalate)
import Data.Semigroup ((<>))
import qualified Data.Set as Set
import Data.Version (showVersion)
-import System.IO (stdout)
+import System.IO (stdout, stderr, hPutStrLn)
import Options.Applicative
import Paths_tldr (version)
import System.Directory
import System.Environment (getArgs, getExecutablePath, lookupEnv)
+import System.Exit (exitFailure)
import System.FilePath
import System.Process.Typed
import Data.Char (toLower)
@@ -196,7 +197,9 @@ handleTldrOpts opts@TldrOpts {..} = do
Just path -> renderPage path stdout
Nothing -> do
if checkLocale locale
- then putStrLn ("No tldr entry for " <> (intercalate " " pages))
+ then do
+ hPutStrLn stderr ("No tldr entry for " <> (intercalate " " pages))
+ exitFailure
else handleTldrOpts
(opts
{ tldrAction =