summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md4
-rw-r--r--README.md5
-rw-r--r--app/Main.hs7
-rw-r--r--tldr.cabal4
4 files changed, 15 insertions, 5 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 37f2b19..53dcf78 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+# 0.7.1
+
+* Client gives non zero exit status for non-existent pages.
+
# 0.7.0
* Make it obey --language (-L) option.
diff --git a/README.md b/README.md
index 29a1d8b..5f98159 100644
--- a/README.md
+++ b/README.md
@@ -25,7 +25,8 @@ Or
$ tldr --help
tldr - Simplified and community-driven man pages
-Usage: tldr [-v|--version] ((-u|--update) | [-p|--platform PLATFORM] COMMAND)
+Usage: tldr [-v|--version] ((-u|--update) | [-p|--platform PLATFORM]
+ [-L|--language LOCALE] COMMAND | (-a|--about))
tldr Client program
Available options:
@@ -34,7 +35,9 @@ Available options:
-u,--update Update offline cache of tldr pages
-p,--platform PLATFORM Prioritize specfic platform while searching. Valid
values include linux, osx, windows, sunos
+ -L,--language LOCALE Preferred language for the page returned
COMMAND name of the command
+ -a,--about About this program
```
Or a much better example of the usage:
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 =
diff --git a/tldr.cabal b/tldr.cabal
index 97a1ad8..fd420d9 100644
--- a/tldr.cabal
+++ b/tldr.cabal
@@ -4,10 +4,10 @@ cabal-version: 1.12
--
-- see: https://github.com/sol/hpack
--
--- hash: 88d378cdcf8422ec2651e3d350ffcb2f0a4f7a46dce43516286864b209522d78
+-- hash: 10ec649ff467c4fa6cedd898599125c78e4b7c56269fac74fe81112e0fec75f9
name: tldr
-version: 0.7.0
+version: 0.7.1
synopsis: Haskell tldr client
description: Haskell tldr client with support for viewing tldr pages. Has offline
cache for accessing pages. Visit https://tldr.sh for more details.