feat: add the --version CLI option to print the version information

This commit is contained in:
Laurence Isla
2023-07-07 18:19:02 -05:00
committed by GitHub
parent e752224f14
commit 774d015eb5
3 changed files with 12 additions and 1 deletions
+7 -1
View File
@@ -80,7 +80,7 @@ readCLIShowHelp =
where
prefs = O.prefs $ O.showHelpOnError <> O.showHelpOnEmpty
opts = O.info parser $ O.fullDesc <> progDesc
parser = O.helper <*> exampleParser <*> cliParser
parser = O.helper <*> versionFlag <*> exampleParser <*> cliParser
progDesc =
O.progDesc $
@@ -88,6 +88,12 @@ readCLIShowHelp =
<> BS.unpack prettyVersion
<> " / create a REST API to an existing Postgres database"
versionFlag =
O.infoOption ("PostgREST " <> BS.unpack prettyVersion) $
O.long "version"
<> O.short 'v'
<> O.help "Show the version information"
exampleParser =
O.infoOption exampleConfigFile $
O.long "example"