jakiestfu / himawari.js

Download real-time images of Earth from the Himawari-8 satellite
http://jakiestfu.github.io/himawari.js/demo/
MIT License
1.81k stars 103 forks source link

`--zoom` is ignored and defaults to 1 #20

Open kilianc opened 8 years ago

kilianc commented 8 years ago

With:

$ himawari --zoom 5 -i

--zoom is ignored and defaults to 1. using latest

This my last attempt for today :beers:

jakiestfu commented 8 years ago

Correct, invalid zooms default to 1... Infrared only supports up to 3 :)

I'm working on getting ava implemented in this today. Sorry you experienced so much trouble, and I am happy to help in any issues you open.

kilianc commented 8 years ago

this is what open source is about!

jakiestfu commented 8 years ago

So, to your misfortune, IR is only up to 3 zoom levels (that I could discern), would you consider this a non-issue?

kilianc commented 8 years ago

Yep but you should use yargs or manually validate the options so that it is transparent to the user what i can or can't do. Def not a bug, but worth enhancing!

jakiestfu commented 8 years ago

Roger that. What experience would you like, for it to throw an err or exit if the options are invalid?

kilianc commented 8 years ago

yep console.error + process.exit(1). if you use a args parser they handle this for you and follow all best practices. I'll suggest you look into yargs.

ungoldman commented 8 years ago

Catching this issue with the behavior you're suggesting above is already possible with the current setup (minimist + cliclopts). See optimist for the yargs/minimist origin story :)

DEPRECATION NOTICE I don't want to maintain this module anymore since I just use minimist, the argument parsing engine, directly instead nowadays.

See yargs for the modern, pirate-themed successor to optimist.