Skip to content
Permalink
Browse files

Also display full version slug with `tl version`

  • Loading branch information
ad-si committed Jan 12, 2020
1 parent b08b09e commit 0c292d1d398e375ef66a8a6c1d238f2500e882ab
Showing with 17 additions and 8 deletions.
  1. +17 −8 tasklite-core/app/Main.hs
@@ -162,6 +162,18 @@ nameToAliasList = (
[])


{- Imitates output from `git describe` -}
versionSlug :: Text
versionSlug =
let
gitInfo = $$tGitInfoCwd
in
fromString $
(showVersion version)
<> "+" <> take 8 (giHash gitInfo)
<> (if giDirty gitInfo then "-dirty" else "")


aliasWarning :: Text -> Doc AnsiStyle
aliasWarning alias =
"Invalid command."
@@ -620,21 +632,18 @@ commandParser conf =
commandParserInfo :: Config -> ParserInfo Command
commandParserInfo conf =
let
gitInfo = $$tGitInfoCwd
versionString =
versionDesc =
"Version "
<> (showVersion version)
<> "+" <> take 8 (giHash gitInfo)
<> (if giDirty gitInfo then "-dirty" else "")
<> ", developed by <adriansieber.com>\n"
<> versionSlug
<> ", developed by <adriansieber.com>"
in
info
(helper <*> commandParser conf)
(noIntersperse
<> briefDesc
<> headerDoc (Just "{{header}}")
<> progDescDoc (Just "{{examples}}")
<> footerDoc (Just $ fromString versionString)
<> footerDoc (Just $ fromString $ T.unpack versionDesc)
)


@@ -800,7 +809,7 @@ executeCLiCommand conf now connection cmd =
{- Unset -}
UnDueTasks ids -> undueTasks conf connection ids

Version -> pure $ pretty (showVersion version) <> hardline
Version -> pure $ pretty versionSlug <> hardline
Help -> pure $ helpText conf
PrintConfig -> pure $ pretty conf
Alias alias -> pure $ aliasWarning alias

0 comments on commit 0c292d1

Please sign in to comment.
You can’t perform that action at this time.