feat: add the --version CLI option to print the version information
This commit is contained in:
@@ -21,6 +21,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
+ Data representations preserve the ability to write to the original column and require no extra storage or complex triggers (compared to using `GENERATED ALWAYS` columns)
|
+ Data representations preserve the ability to write to the original column and require no extra storage or complex triggers (compared to using `GENERATED ALWAYS` columns)
|
||||||
+ Note: data representations require Postgres 10 (Postgres 11 if using `IN` predicates); data representations are not implemented for RPC
|
+ Note: data representations require Postgres 10 (Postgres 11 if using `IN` predicates); data representations are not implemented for RPC
|
||||||
- #2647, Allow to verify the PostgREST version in SQL: `select distinct application_name from pg_stat_activity`. - @laurenceisla
|
- #2647, Allow to verify the PostgREST version in SQL: `select distinct application_name from pg_stat_activity`. - @laurenceisla
|
||||||
|
- #2856, Add the `--version` CLI option that prints the version information - @laurenceisla
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ readCLIShowHelp =
|
|||||||
where
|
where
|
||||||
prefs = O.prefs $ O.showHelpOnError <> O.showHelpOnEmpty
|
prefs = O.prefs $ O.showHelpOnError <> O.showHelpOnEmpty
|
||||||
opts = O.info parser $ O.fullDesc <> progDesc
|
opts = O.info parser $ O.fullDesc <> progDesc
|
||||||
parser = O.helper <*> exampleParser <*> cliParser
|
parser = O.helper <*> versionFlag <*> exampleParser <*> cliParser
|
||||||
|
|
||||||
progDesc =
|
progDesc =
|
||||||
O.progDesc $
|
O.progDesc $
|
||||||
@@ -88,6 +88,12 @@ readCLIShowHelp =
|
|||||||
<> BS.unpack prettyVersion
|
<> BS.unpack prettyVersion
|
||||||
<> " / create a REST API to an existing Postgres database"
|
<> " / 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 =
|
exampleParser =
|
||||||
O.infoOption exampleConfigFile $
|
O.infoOption exampleConfigFile $
|
||||||
O.long "example"
|
O.long "example"
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ cli:
|
|||||||
args: ['--help']
|
args: ['--help']
|
||||||
- name: help short
|
- name: help short
|
||||||
args: ['-h']
|
args: ['-h']
|
||||||
|
- name: version long
|
||||||
|
args: ['--version']
|
||||||
|
- name: version short
|
||||||
|
args: ['-v']
|
||||||
- name: example long
|
- name: example long
|
||||||
args: ['--example']
|
args: ['--example']
|
||||||
- name: example short
|
- name: example short
|
||||||
|
|||||||
Reference in New Issue
Block a user