This repository was archived by the owner on Sep 20, 2022. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathcli.js
More file actions
81 lines (78 loc) · 1.98 KB
/
Copy pathcli.js
File metadata and controls
81 lines (78 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
9028
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
'use strict';
var path = require('path'),
opener = require('opener'),
chalk = require('chalk'),
pkg = require('../package.json'),
server = require('./server');
try {
require('source-map-support').install();
} catch (e) {}
module.exports = require('coa').Cmd()
.name(process.argv[1])
.title(pkg.description)
.helpful()
.opt()
.name('version')
.title('Show version')
.long('version')
.flag()
.end()
.opt()
.name('port')
.title('Port to launch server on')
.long('port')
.short('p')
.def(8000)
.end()
.opt()
.name('hostname')
.title('Hostname to launch server on')
.long('hostname')
.short('h')
.def('localhost')
.end()
.opt()
.name('configFile')
.title('Gemini config file')
.long('config')
.short('c')
.val(function(config) {
return path.resolve(config);
})
.end()
.opt()
.name('rootUrl')
.long('root-url').short('r')
.title('Override root url')
.end()
.opt()
.name('gridUrl')
.long('grid-url').short('g')
.title('Override grid url')
.end()
.opt()
.name('screenshotsDir')
.long('screenshots-dir').short('s')
.title('Override screenshots dir')
.end()
.opt()
.name('debug')
.long('debug')
.flag()
.title('Turn on debugging output to the console')
.end()
.arg()
.name('testFiles')
.title('Paths to files or directories, containing tests')
.arr()
.end()
.act(function(options, args) {
if (options.version) {
return pkg.version;
}
options.testFiles = args.testFiles;
return server.start(options).then(function(result) {
console.log('GUI is running at %s', chalk.cyan(result.url));
opener(result.url);
});
});