forked from bosconian-dynamics/hackshell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.js
More file actions
32 lines (27 loc) · 687 Bytes
/
cli.js
File metadata and controls
32 lines (27 loc) · 687 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
var fs = require( 'fs' )
var path = require( 'path' )
var pkg = require( './package.json' )
var CLI = require( './' + pkg.directories.dist + '/hackshell-cli.js' )
var options = {}
var tokens = process.argv.slice(2)
for( var i = 0; i < tokens.length; i++ ) {
var token = tokens[i]
switch( token ) {
case "--directory":
case "-d":
options.scriptDir = tokens[++i]
break
case "--chatdelay":
case "-c":
options.chatDelay = parseInt( tokens[++i], 10 )
break
case "--user":
case "-u":
options.username = tokens[++i]
console.log( "username: " + options.username )
break
default:
break
}
}
new CLI( options )