simpler CLI
This commit is contained in:
parent
164a972faa
commit
37e724cd76
8
app.js
8
app.js
@ -11,20 +11,18 @@ const exec_name = args[0].split('/').pop();
|
||||
const server_port = args[1];
|
||||
const clients_list = args.slice(2);
|
||||
|
||||
if(server_port){
|
||||
console.log('port:', server_port, 'clients:', clients_list)
|
||||
|
||||
}else{
|
||||
if(server_port === "help"){
|
||||
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} 7575 10.1.0.1:7575 10.2.0.1:7575 10.3.0.1:7575` )
|
||||
process.exit(0)
|
||||
}
|
||||
|
||||
console.log('port:', server_port, 'clients:', clients_list)
|
||||
|
||||
app.p2p = new P2P({
|
||||
listenPort: server_port,
|
||||
peers: clients_list
|
||||
})
|
||||
|
||||
app.pubsub = require('./pubsub')
|
||||
app.pubsub = require('./pubsub')
|
||||
|
@ -2,7 +2,7 @@
|
||||
"name": "vpn-p2p",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"main": "app.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user