From 4f30223c93254b59ed21bdc6e3cb56926f09a20d Mon Sep 17 00:00:00 2001 From: damianfral Date: Sat, 1 Apr 2023 00:50:09 +0000 Subject: [PATCH] Add version to CLI header. --- src/GitHub/CLI.hs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/GitHub/CLI.hs b/src/GitHub/CLI.hs index 654cef0..3555c79 100644 --- a/src/GitHub/CLI.hs +++ b/src/GitHub/CLI.hs @@ -20,6 +20,8 @@ import Options.Applicative.Types import Options.Generic import Relude hiding (sort) import qualified Turtle +import Data.Version (showVersion) +import Paths_github_ls -------------------------------------------------------------------------------- @@ -199,7 +201,13 @@ runOptions Options {..} auth = do Just s -> V.modify (sortReposBy s) repos runCLI = do - options <- unwrapRecord "github-ls - List your github repositories" + options <- + unwrapRecord $ + unwords + [ "github-ls", + "v" <> pack (showVersion version), + " List your github repositories" + ] token <- runMaybeT $ MaybeT getAuthToken <|> MaybeT (login >> getAuthToken) case token of Nothing -> log "No auth" >> exitFailure