diff --git a/CHANGELOG.md b/CHANGELOG.md index e0a6cdced4..06e50c2add 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) + 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 + - #2856, Add the `--version` CLI option that prints the version information - @laurenceisla ### Fixed diff --git a/src/PostgREST/CLI.hs b/src/PostgREST/CLI.hs index 5508d985dd..8f4626ad4a 100644 --- a/src/PostgREST/CLI.hs +++ b/src/PostgREST/CLI.hs @@ -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" diff --git a/test/io/fixtures.yaml b/test/io/fixtures.yaml index 8aa8993fd9..c27e0007b0 100644 --- a/test/io/fixtures.yaml +++ b/test/io/fixtures.yaml @@ -4,6 +4,10 @@ cli: args: ['--help'] - name: help short args: ['-h'] + - name: version long + args: ['--version'] + - name: version short + args: ['-v'] - name: example long args: ['--example'] - name: example short