diff --git a/readme.md b/readme.md index 066d7e6..6b6ef37 100644 --- a/readme.md +++ b/readme.md @@ -192,6 +192,13 @@ You can see the exact location of the cache by simply running the following line > require('env-paths')('jay-repl').cache ``` +## How to find out the jay version installed? + +There is a cli flag `--version` that shows the jay version. + +```bash +$ jay --version # jay version is 0.2.2 +``` # Contributing diff --git a/source/cli.ts b/source/cli.ts index 2306226..e8c691f 100644 --- a/source/cli.ts +++ b/source/cli.ts @@ -57,6 +57,11 @@ if (semver.lt(process.version, '10.0.0')) { process.exit(1) } +if (process.argv[2] === '--version') { + console.log(c.magenta(`jay version is ${packageJson.version}`)) + process.exit() +} + updateNotifier({ pkg: packageJson }).notify()