madnight / bitcoin-chart-cli

Bitcoin chart for the terminal as command line util
MIT License
305 stars 40 forks source link

Provide option for user defined coins #5

Closed madnight closed 7 years ago

madnight commented 7 years ago

@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

kroitor commented 7 years ago
"use strict";
let coin = null
process.argv.forEach (arg => {
    if (arg.indexOf ('--coin') >= 0)
        coin = arg.split ('=')[1]
})
console.log (coin)
madnight commented 7 years ago

@kroitor thx, i think i need to rewrite it a bit, my linter settings are quite strong (no mutation allowed / only immutable values (const))

kroitor commented 7 years ago
"use strict";
// almost pure functional )
const coin = (process.argv.filter (x => x.indexOf ('--coin') >= 0)[0] || '--coin=default').split ('=')[1]
console.log (coin)
madnight commented 7 years ago

done! version 3.0 released thx to @BlkChockr and @kroitor

kroitor commented 7 years ago

Cool! )