summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpsibi <>2018-01-12 21:04:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2018-01-12 21:04:00 (GMT)
commit43123242a9fdfdb6c85c4ad86cd3eac7762e2b6a (patch)
tree623faebba56c8c424a9f7270f89d4db38acf35cf
parent5af00cb8e7f3fe6c349fbd7de49e83740751e007 (diff)
version 0.2.50.2.5
-rw-r--r--CHANGELOG.md4
-rw-r--r--app/Main.hs19
-rw-r--r--tldr.cabal2
3 files changed, 13 insertions, 12 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 892e111..3b141b0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+# 0.2.5
+
+* Fix eager cloning
+
# 0.2.4
* Don't do cloning unnecessarily [#7](https://github.com/psibi/tldr-hs/issues/7)
diff --git a/app/Main.hs b/app/Main.hs
index 10536c8..0ef8927 100644
--- a/app/Main.hs
+++ b/app/Main.hs
@@ -100,15 +100,12 @@ main :: IO ()
main = do
args <- getArgs
case execParserPure (prefs noBacktrack) tldrParserInfo args of
- Failure _
- | null args -> handleParseResult . Failure $ parserFailure defaultPrefs tldrParserInfo ShowHelpText mempty
+ failOpts@(Failure _)
| args == ["--update"] -> updateTldrPages
- (parseResult :: ParserResult TldrOpts) -> do
- case args of
- ["--help"] -> handleParseResult . Failure $ parserFailure defaultPrefs tldrParserInfo ShowHelpText mempty
- _ -> do
- initializeTldrPages
- opts <- handleParseResult parseResult
- let page = pageName opts
- fname <- getPagePath page
- maybe (putStrLn ("No tldr entry for " <> page)) renderPage fname
+ | otherwise -> handleParseResult failOpts >> return ()
+ Success opts -> do
+ initializeTldrPages
+ let page = pageName opts
+ fname <- getPagePath page
+ maybe (putStrLn ("No tldr entry for " <> page)) renderPage fname
+ _ -> return ()
diff --git a/tldr.cabal b/tldr.cabal
index 002ca52..bd03907 100644
--- a/tldr.cabal
+++ b/tldr.cabal
@@ -1,5 +1,5 @@
name: tldr
-version: 0.2.4
+version: 0.2.5
synopsis: Haskell tldr client
description: Haskell tldr client with support for updating and viewing tldr pages.
homepage: https://github.com/psibi/tldr-hs#readme