simpler CLI
This commit is contained in:
parent
164a972faa
commit
37e724cd76
6
app.js
6
app.js
@ -11,16 +11,14 @@ const exec_name = args[0].split('/').pop();
|
|||||||
const server_port = args[1];
|
const server_port = args[1];
|
||||||
const clients_list = args.slice(2);
|
const clients_list = args.slice(2);
|
||||||
|
|
||||||
if(server_port){
|
if(server_port === "help"){
|
||||||
console.log('port:', server_port, 'clients:', clients_list)
|
|
||||||
|
|
||||||
}else{
|
|
||||||
console.error('Please supply the server port and list of clients to connect too;')
|
console.error('Please supply the server port and list of clients to connect too;')
|
||||||
console.error(`${exec_name} <server port> <client 1> <client 2> <client 3> ...` )
|
console.error(`${exec_name} <server port> <client 1> <client 2> <client 3> ...` )
|
||||||
console.error(`${exec_name} 7575 10.1.0.1:7575 10.2.0.1:7575 10.3.0.1:7575` )
|
console.error(`${exec_name} 7575 10.1.0.1:7575 10.2.0.1:7575 10.3.0.1:7575` )
|
||||||
process.exit(0)
|
process.exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log('port:', server_port, 'clients:', clients_list)
|
||||||
|
|
||||||
app.p2p = new P2P({
|
app.p2p = new P2P({
|
||||||
listenPort: server_port,
|
listenPort: server_port,
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"name": "vpn-p2p",
|
"name": "vpn-p2p",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "app.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user