forked from spencerkohan/neo4ji
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathneo4ji-cli.js
executable file
·61 lines (48 loc) · 1.69 KB
/
neo4ji-cli.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
#!/usr/bin/env node
var neo4ji = require(__dirname + '/neo4ji.js');
var args = require('minimist')(process.argv.slice(2));
var command = args._[0];
var instanceName = args._[1];
switch(command){
case "create":
console.log('creating: ' + instanceName + '...');
neo4ji.createInstance(instanceName, args.V)
break;
case "destroy":
console.log('destroying: ' + instanceName + '...');
neo4ji.destroyInstance(instanceName)
break;
case "start":
console.log('starting: ' + instanceName + '...');
neo4ji.startInstance(instanceName, args.V)
break;
case "stop":
console.log('stopping: ' + instanceName + '...');
neo4ji.stopInstance(instanceName)
break;
case "instances":
console.log(JSON.stringify(neo4ji.instances(), null, 4));
break;
case "config":
if(args.V){
neo4ji.config({neo4jVersion:args.V});
console.log('updated configuration:')
console.log(JSON.stringify(neo4ji.config(), null, 4));
}else{
console.log('\tno options updated');
console.log('usage: ');
console.log('\tconfig -V <version>\t\t: set the default version');
}
break;
default:
console.log('usage: ');
console.log('\tcreate <instance name>\t\t: create a new instance with the given name');
console.log('\tdestroy <instance name>\t\t: destroy instance with the given name');
console.log('\tstart <instance name>\t\t: start instance with the given name');
console.log('\tstop <instance name>\t\t: stop instance with the given name');
console.log('\tconfig -V <version>\t\t: set the default neo4j version');
console.log('\tinstances\t\t\t: list all instances');
break;
}
console.log('finished.');
process.exit(0);