Red5d / pushbullet-bash

Bash interface to the PushBullet API
235 stars 41 forks source link

Make the 'push link' arguments more robust #57

Closed KronK0321 closed 8 years ago

KronK0321 commented 8 years ago

I've modified the script slightly to fit a common use case I had where I didn't care about giving the link a title.

This change allows for the following arguments and handles missing ones gracefully. In the case where a title is omitted, the link URL is used as the title.

./pushbullet push all link http://link
./pushbullet push all link http://link <message>

./pushbullet push all link <title> http://link
./pushbullet push all link <title> http://link <message>

./pushbullet push all link <title> <message> http://link

If none of the arguments contains http:// or https://, the existing logic catches it and exits the script.

It could probably still be more robust but I figured others could benefit from this change.