-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathmain.js
More file actions
48 lines (39 loc) · 932 Bytes
/
main.js
File metadata and controls
48 lines (39 loc) · 932 Bytes
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
"use strict"
/**
*
*
*
*/
var UI = require('./ui.js'),
OCPP = require('./ocpp-protocol.js'),
Utils = require('./utils.js');
function main() {
// if arguments in shell
if(process.argv.length > 2) {
var args = process.argv.slice(2);
// non-documented option
for(var i = 0; i < args.length; i++) {
if(args[i] == '--with-attr-at') {
OCPP.enableAttributesWithAt();
args.splice(i, 1);
break;
}
}
if (UI.parseCommand(args) == -1) {
// if error just print the usage and quit
UI.rl.close();
return;
}
}
else {
console.log("== GIR ocppjs - OCPP CentralSystem & ChargePoint Simulator ==");
console.log(" > Quick start :");
UI.getHelp();
}
// read WSDL files and fill the data structures
OCPP.readWSDLFiles();
OCPP.buildJSONSchemas();
// launch the command line interface
UI.commandLine();
}
exports.main = main;