#!/usr/bin/env phantomjs
/**
 * PhantomJS-based web performance metrics collector
 *
 * Usage:
 *  ./phantomas.js
 *    --url=<page to check>
 *    [--format=json|csv|plain]
 *    [--timeout=5]
 *    ]--viewport=<width>x<height>]
 *    [--verbose]
 *    [--silent]
 *    [--log=<log file>]
 *    [--modules=moduleOne,moduleTwo]
 *    [--user-agent='Custom user agent']
 *    [--config='JSON config file']
 *    [--cookie='bar=foo;domain=url']
 *    [--cookies-file=/path/to/cookies.txt]
 *    [--no-externals]
 *    [--allow-domain='domain,domain']
 *    [--block-domain='domain,domain']
 */
var args = require('system').args,
	// get absolute path (useful when phantomas is installed globally)
	dir = require('fs').readLink(args[0]).replace(/phantomas.js$/, '') || '.',
	// parse script arguments
	params = require(dir + '/lib/args').parse(args),
	phantomas = require(dir + '/core/phantomas'),
	instance;

// run phantomas
instance = new phantomas(params);

try {
	instance.run();
}
catch(ex) {
	console.log('phantomas v' + phantomas.version + ' failed with an error:');
	console.log(ex);

	phantom.exit(1);
}

#!/usr/bin/env phantomjs
/**
 * PhantomJS-based web performance metrics collector
 *
 * Usage:
 *  ./phantomas.js
 *    --url=<page to check>
 *    [--format=json|csv|plain]
 *    [--timeout=5]
 *    ]--viewport=<width>x<height>]
 *    [--verbose]
 *    [--silent]
 *    [--log=<log file>]
 *    [--modules=moduleOne,moduleTwo]
 *    [--user-agent='Custom user agent']
 *    [--config='JSON config file']
 *    [--cookie='bar=foo;domain=url']
 *    [--no-externals]
 *    [--allow-domain='domain,domain']
 *    [--block-domain='domain,domain']
 */
var args = require('system').args,
	// get absolute path (useful when phantomas is installed globally)
	dir = require('fs').readLink(args[0]).replace(/phantomas.js$/, '') || '.',
	// parse script arguments
	params = require(dir + '/lib/args').parse(args),
	phantomas = require(dir + '/core/phantomas'),
	instance;

// run phantomas
instance = new phantomas(params);

try {
	instance.run();
}
catch(ex) {
	console.log('phantomas v' + phantomas.version + ' failed with an error:');
	console.log(ex);

	phantom.exit(1);
}

Remove --cookies-file option for now.
Remove --cookies-file option for now.

I can't figure out if there are any public APIs for working with
the binary cookie formats that PhantomJS now uses.

Not sure if there are any functions exposed that would let us interpret
them correctly, and attempting to parse cookie binaries might not
be super useful.
