jmtellez / CLI-mate

Node CLI app that gives you the weather forecast for a given city.
6 stars 10 forks source link

Options order #11

Closed jmtellez closed 3 years ago

jmtellez commented 3 years ago

Work on the order on how the location and units are passed. Order should not matter:

$ cli-mate Dallas --u=m
$ cli-mate --u=m Dallas

both should return the same output:

✔ Dallas, Texas, United States
Partly cloudy. It is currently 23°C, it feels like 24°C.
sampjr commented 3 years ago

The following command returns actual data haha!

cli-mate --u=m Dallas

https://api.mapbox.com/geocoding/v5/mapbox.places/--u%3Dm.json?access_token= √ U-M Soccer Complex, 2250 S. State St., Ann Arbor, Michigan 48103, United States

jmtellez commented 3 years ago

Right it's taking the first argument as the location.

jsilvaigor commented 3 years ago

We can improve argument parsing using a library like argparse and it will also auto-generate the help menu based on the configs. I'll fork the repo and open a PR making this changes.

vzsky commented 3 years ago

Sorry @jsilvaigor. I didn't see your comment and I managed to solve this issue. Please refer to #13

jsilvaigor commented 3 years ago

No problem @vzsky