simpler CLI

This commit is contained in:
William Mantly 2020-08-21 17:03:55 -04:00
parent 164a972faa
commit 37e724cd76
Signed by: wmantly
GPG Key ID: 186A8370EFF937CA
2 changed files with 4 additions and 6 deletions

8
app.js
View File

@ -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')

View File

@ -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"
},