juliangruber/review — pull request #13 by jzelenkov (2014-07-08 14:51:01+00:00)
Title: Support for cookies array from the command line

Currently command line argument `cookie` accepts an object representing one coookie. Object contains properties like `name`, `value`, `domain`, `path` etc. That object is then send directly to `phantom.addCookie()` function as an argument. [phantomjs addCookie API](http://phantomjs.org/api/webpage/method/add-cookie.html)

This PR extends `cookie` command line argument to accept more than one cookie. The syntax is based on the `phantomjs` `cookies` property. [phantomjs cookies property API](http://phantomjs.org/api/phantom/property/cookies.html)

The following logic applies:

* if `--cookie` object is empty or undefined, do nothing

* if `--cookie` object received from the command line has property named `cookies`, then we are dealing with multiple cookies. Iterate over `cookies` array and call `phantom.addCookie()` for each array element.

* if `--cookie` object doesn't exist, then a single cookie was passed. Send object to `phantomjs.addCookie()` directly. _(current implementation)_

Extends functionality introduced in #4