Commit 8772328e 8772328ef2ce27b1dff808f19507d0b03be3a14b by Nicolas Perriault

closes #392 - casperjs exec gets --direct & --log-level options

1 parent 8b891188
......@@ -64,7 +64,7 @@ Last, all the casper test suites have been upgraded to use the new testing featu
### Bugfixes & enhancements
None yet.
- closed [#392](https://github.com/n1k0/casperjs/issues/392) - `--direct` & `--log-level` options available for the `casperjs` executable
2013-02-08, v1.0.2
------------------
......
......@@ -5,7 +5,9 @@ Usage: casperjs [options] script.[js|coffee] [script argument [script argument .
Options:
--direct Prints log messages to the console
--log-level Sets logging level
--help Prints this help
--version Prints out CasperJS version
Read the docs http://casperjs.org/
Read the docs http://docs.casperjs.org/
......
......@@ -122,10 +122,15 @@ var Casper = function Casper(options) {
};
// options
this.options = utils.mergeObjects(this.defaults, options);
// properties
this.checker = null;
// factories
this.cli = phantom.casperArgs;
this.options.logLevel = this.cli.get('log-level') || this.options.logLevel;
this.options.verbose = this.cli.get('direct') || this.options.verbose;
this.colorizer = this.getColorizer();
this.mouse = mouse.create(this);
this.popups = pagestack.create();
// properties
this.checker = null;
this.currentResponse = undefined;
this.currentUrl = 'about:blank';
this.currentHTTPStatus = null;
......@@ -140,10 +145,8 @@ var Casper = function Casper(options) {
warning: 'COMMENT',
error: 'ERROR'
};
this.mouse = mouse.create(this);
this.page = null;
this.pendingWait = false;
this.popups = pagestack.create();
this.requestUrl = 'about:blank';
this.resources = [];
this.result = {
......
......@@ -53,8 +53,6 @@ function checkIncludeFile(include) {
function checkArgs() {
"use strict";
// parse some options from cli
casper.options.verbose = casper.cli.get('direct') || false;
casper.options.logLevel = casper.cli.get('log-level') || "error";
if (casper.cli.get('no-colors') === true) {
var cls = 'Dummy';
casper.options.colorizerType = cls;
......