Skip to content

Commit

Permalink
Trim trailing whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
a1346054 committed Sep 14, 2021
1 parent 2cc4995 commit 25ca774
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/Tldr/App.hs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ noColorFlag =
(flag' NoColor
(long "no-color" <>
help
"Disable colored output"))
"Disable colored output"))

colorFlags :: Parser (Maybe ColorSetting)
colorFlags = useColorFlag <|> noColorFlag
Expand Down
10 changes: 5 additions & 5 deletions src/Tldr/App/Handler.hs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ handleTldrOpts opts@TldrOpts {..} =
About -> handleAboutFlag
ViewPage voptions pages -> do
shouldPerformUpdate <- updateNecessary opts
when shouldPerformUpdate updateTldrPages
when shouldPerformUpdate updateTldrPages
let npage = intercalate "-" pages
locale <-
case languageOption voptions of
Expand All @@ -82,7 +82,7 @@ handleTldrOpts opts@TldrOpts {..} =
case fname of
Just path -> do
defColor <- getNoColorEnv
let color = fromMaybe defColor colorSetting
let color = fromMaybe defColor colorSetting
renderPage path stdout color
Nothing ->
if checkLocale locale
Expand All @@ -99,13 +99,13 @@ updateNecessary :: TldrOpts -> IO Bool
updateNecessary TldrOpts{..} = do
dataDir <- getXdgDirectory XdgData tldrDirName
dataDirExists <- doesDirectoryExist dataDir
if not dataDirExists
if not dataDirExists
then return True
else do
lastCachedTime <- getModificationTime dataDir
currentTime <- getCurrentTime
let diffExceedsLimit limit
= currentTime `diffUTCTime` lastCachedTime
let diffExceedsLimit limit
= currentTime `diffUTCTime` lastCachedTime
> fromIntegral limit * nominalDay
return $ maybe False diffExceedsLimit autoUpdateInterval

Expand Down
2 changes: 1 addition & 1 deletion src/Tldr/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import System.Console.ANSI

data Locale = English | Missing | Other String | Unknown String

data ColorSetting = NoColor | UseColor
data ColorSetting = NoColor | UseColor
deriving (Eq, Show, Ord, Enum, Bounded)

data ConsoleSetting =
Expand Down
2 changes: 1 addition & 1 deletion test/Spec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ commandTest str = goldenVsFile (str <> " test") (golden str) (output str) (rende
md cmd = prefix <> cmd <> ".md"

gtests :: TestTree
gtests = testGroup "(render test)"
gtests = testGroup "(render test)"
[
commandTest "ls"
, commandTest "ps"
Expand Down

0 comments on commit 25ca774

Please sign in to comment.