Closed madnight closed 7 years ago
"use strict";
let coin = null
process.argv.forEach (arg => {
if (arg.indexOf ('--coin') >= 0)
coin = arg.split ('=')[1]
})
console.log (coin)
@kroitor thx, i think i need to rewrite it a bit, my linter settings are quite strong (no mutation allowed / only immutable values (const))
"use strict";
// almost pure functional )
const coin = (process.argv.filter (x => x.indexOf ('--coin') >= 0)[0] || '--coin=default').split ('=')[1]
console.log (coin)
done! version 3.0 released thx to @BlkChockr and @kroitor
Cool! )
@BlkChockr suggested that the user should be able to define any coin in an generic way by adding its code as param
bitcoin-chart-cli --coin ETH