mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
Add --help and --version command line arguments (#1278)
* Added --help command line argument. Also looks for -v and --version. * Fixing linting issues. * Deleted incorrect comment that used to make sense. * Cleaner arguments checking. * Used newer JS syntax.
This commit is contained in:
parent
a0a8484158
commit
edff890f5f
1 changed files with 11 additions and 0 deletions
11
app/index.js
11
app/index.js
|
|
@ -1,3 +1,14 @@
|
|||
// Print diagnostic information for a few arguments instead of running Hyper.
|
||||
if (['--help', '-v', '--version'].includes(process.argv[1])) {
|
||||
const {version} = require('./package');
|
||||
const configLocation = process.platform === 'win32' ? process.env.userprofile + '\\.hyper.js' : '~/.hyper.js';
|
||||
console.log(`Hyper version ${version}`);
|
||||
console.log('Hyper does not accept any command line arguments. Please modify the config file instead.');
|
||||
console.log(`Hyper configuration file located at: ${configLocation}`);
|
||||
// eslint-disable-next-line unicorn/no-process-exit
|
||||
process.exit();
|
||||
}
|
||||
|
||||
// handle startup squirrel events
|
||||
if (process.platform === 'win32') {
|
||||
// eslint-disable-next-line import/order
|
||||
|
|
|
|||
Loading…
Reference in a new issue