[CLI] added 'version' command. (#3207)

This commit is contained in:
Peder Husom 2018-09-25 00:48:44 +02:00 committed by CHaBou
parent a6229a5eef
commit 09fee126b0

View file

@ -3,6 +3,7 @@
const {spawn, exec} = require('child_process');
const {isAbsolute, resolve} = require('path');
const {existsSync} = require('fs');
const {version} = require('../app/package');
const pify = require('pify');
const args = require('args');
const chalk = require('chalk');
@ -133,6 +134,11 @@ args.command(['d', 'docs', 'h', 'home'], 'Open the npm page of a plugin', (name,
process.exit(0);
});
args.command(['version'], 'Show the version of hyper', () => {
console.log(version);
process.exit(0);
});
args.command(['<default>'], 'Launch Hyper');
args.option(['v', 'verbose'], 'Verbose mode', false);