Comparing version 1.0.6 to 1.0.7
#!/usr/bin/env node | ||
'use strict' | ||
var argv = require('./src/argv') | ||
const WebSocket = require('ws'); | ||
var opts = { | ||
host: argv.host || 'sharktail.herokuapp.com', | ||
port: argv.port || 2390, | ||
delay: argv.delay || null | ||
} | ||
host: argv.host, | ||
port: argv.port | ||
} | ||
console.log(opts) | ||
@@ -10,0 +11,0 @@ const mySocket = new WebSocket(`ws://${opts.host}:${opts.port}`); |
{ | ||
"name": "sharktail", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "Official Sharktail CLI written in Node.js", | ||
@@ -24,8 +24,14 @@ "main": "index.js", | ||
}, | ||
"keywords": ["stream terminal","share terminal","monitor","sharktail"], | ||
"keywords": [ | ||
"stream terminal", | ||
"share terminal", | ||
"monitor", | ||
"sharktail" | ||
], | ||
"author": "Yigit Alparslan (ya332)", | ||
"license": "MIT", | ||
"dependencies": { | ||
"yargs": "^17.0.1" | ||
"yargs": "^17.0.1", | ||
"ws": "^7.4.5" | ||
} | ||
} |
var argv = require('yargs') | ||
.usage('Usage: echo "hello" | sharktail') | ||
.help('help') | ||
.alias('help', 'h') | ||
.option('host', { | ||
@@ -9,3 +8,4 @@ alias: 'h', | ||
describe: 'custom host (default sharktail.herokuapp.com)', | ||
type: 'string' | ||
type: 'string', | ||
default: 'sharktail.herokuapp.com' | ||
}) | ||
@@ -16,9 +16,11 @@ .option('port', { | ||
describe: 'custom port (default 2390)', | ||
type: 'number' | ||
type: 'number', | ||
default: 2390 | ||
}) | ||
.example('echo "hello" | sharktail') | ||
.example('echo "hello" | sharktail --host myHost.io --port 1337') | ||
.epilogue('@Author: Yigit Alparslan - github.com/ya332/sharktail-cli - @Copyright 2021') | ||
.example('echo "hello" | sharktail --host 127.0.0.1 --port 2390') | ||
.epilogue('@Author: Yigit Alparslan - github.com/ya332/sharktail - @Copyright 2021') | ||
.argv | ||
module.exports = argv |
3844
41
2