Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CLI #1

Merged
merged 1 commit into from
Feb 8, 2016
Merged

Add CLI #1

merged 1 commit into from
Feb 8, 2016

Conversation

ungoldman
Copy link
Contributor

Awesome module! I added a command line interface so you can do something like:

$ npm i -g himawari
$ himawari --help

Usage: himawari [options]
    --zoom, -z            The zoom level of the image. Can be 1-4. (default: 1)
    --date, -d            The time of the picture desired. If you want to get the latest image, use "latest". (default: "latest")
    --outfile, -o         The location to save the resulting image. (default: "himawari-{date}.jpg" in current directory)
    --help, -h            show help

$ himawari -o ~/Desktop/earth-latest.jpg

Creating earth-latest.jpg in /Users/ng/Desktop ...
Saved 1/16
Saved 2/16
Saved 3/16
Saved 4/16
Saved 5/16
Saved 6/16
Saved 7/16
Saved 8/16
Saved 9/16
Saved 10/16
Saved 11/16
Saved 12/16
Saved 13/16
Saved 14/16
Saved 15/16
Saved 16/16
Complete!

Please let me know if you're open to adding this to your module and if you want me to make any changes to the interface.

If you prefer I can also publish this as a separate module (e.g. himawari-cli).

@jakiestfu
Copy link
Owner

Sick man, thanks for this! Going to add a couple comments.

himawari({
zoom: argv.zoom || 1,
outfile: outfile,
date: argv.date || 'latest',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we assume the defaults have been loaded already? argv.date as well as argv.zoom ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point, I'll remove || 1 & || 'latest'

jakiestfu added a commit that referenced this pull request Feb 8, 2016
@jakiestfu jakiestfu merged commit 65bce12 into jakiestfu:master Feb 8, 2016
@jakiestfu
Copy link
Owner

Thanks @ngoldman!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants