-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.js
66 lines (53 loc) · 1.26 KB
/
index.js
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
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
#! /usr/bin/env node
const program = require('commander');
var options = [];
program
.version('1.1.0')
.option('-l, --live', 'Live')
.option('-lu, --live-updates', 'Live Updates')
.option('-f, --frequency <frequency>', 'Frequency of updates in seconds')
.option('-c, --commentary', 'Commentary')
.option('-s, --scorecard', 'Scorecard')
.option('-u, --umpires', 'Umpires')
.option('-r, --recent', 'Recent')
.option('-t, --toss', 'Toss')
.option('-a, --all', 'All')
.parse(process.argv);
if (program.live || program.all)
{
options.push("l");
}
if (program['live-updates'] || program.all)
{
options.push("lu");
}
if (program.frequency) {
options.frequency = program.frequency * 1000;
}
if (program.commentary || program.all)
{
options.push("c");
}
if (program.scorecard || program.all)
{
options.push("s");
}
if (program.umpires || program.all)
{
options.push("u");
}
if (program.recent || program.all)
{
options.push("r");
}
if (program.toss || program.all)
{
options.push("t");
}
if (!program.live && !program.commentary && !program.scorecard && !program.umpires && !program.recent && !program.toss && !program.all)
{
options.push("l");
}
var MatchIndex = require('./MatchIndex')
MatchIndex.checkMatchAndDisplay(options);
program.parse(process.argv);