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 ...@@ -64,7 +64,7 @@ Last, all the casper test suites have been upgraded to use the new testing featu
64 64
65 ### Bugfixes & enhancements 65 ### Bugfixes & enhancements
66 66
67 None yet. 67 - closed [#392](https://github.com/n1k0/casperjs/issues/392) - `--direct` & `--log-level` options available for the `casperjs` executable
68 68
69 2013-02-08, v1.0.2 69 2013-02-08, v1.0.2
70 ------------------ 70 ------------------
......
...@@ -5,7 +5,9 @@ Usage: casperjs [options] script.[js|coffee] [script argument [script argument . ...@@ -5,7 +5,9 @@ Usage: casperjs [options] script.[js|coffee] [script argument [script argument .
5 5
6 Options: 6 Options:
7 7
8 --direct Prints log messages to the console
9 --log-level Sets logging level
8 --help Prints this help 10 --help Prints this help
9 --version Prints out CasperJS version 11 --version Prints out CasperJS version
10 12
11 Read the docs http://casperjs.org/ 13 Read the docs http://docs.casperjs.org/
......
...@@ -122,10 +122,15 @@ var Casper = function Casper(options) { ...@@ -122,10 +122,15 @@ var Casper = function Casper(options) {
122 }; 122 };
123 // options 123 // options
124 this.options = utils.mergeObjects(this.defaults, options); 124 this.options = utils.mergeObjects(this.defaults, options);
125 // properties 125 // factories
126 this.checker = null;
127 this.cli = phantom.casperArgs; 126 this.cli = phantom.casperArgs;
127 this.options.logLevel = this.cli.get('log-level') || this.options.logLevel;
128 this.options.verbose = this.cli.get('direct') || this.options.verbose;
128 this.colorizer = this.getColorizer(); 129 this.colorizer = this.getColorizer();
130 this.mouse = mouse.create(this);
131 this.popups = pagestack.create();
132 // properties
133 this.checker = null;
129 this.currentResponse = undefined; 134 this.currentResponse = undefined;
130 this.currentUrl = 'about:blank'; 135 this.currentUrl = 'about:blank';
131 this.currentHTTPStatus = null; 136 this.currentHTTPStatus = null;
...@@ -140,10 +145,8 @@ var Casper = function Casper(options) { ...@@ -140,10 +145,8 @@ var Casper = function Casper(options) {
140 warning: 'COMMENT', 145 warning: 'COMMENT',
141 error: 'ERROR' 146 error: 'ERROR'
142 }; 147 };
143 this.mouse = mouse.create(this);
144 this.page = null; 148 this.page = null;
145 this.pendingWait = false; 149 this.pendingWait = false;
146 this.popups = pagestack.create();
147 this.requestUrl = 'about:blank'; 150 this.requestUrl = 'about:blank';
148 this.resources = []; 151 this.resources = [];
149 this.result = { 152 this.result = {
......
...@@ -53,8 +53,6 @@ function checkIncludeFile(include) { ...@@ -53,8 +53,6 @@ function checkIncludeFile(include) {
53 function checkArgs() { 53 function checkArgs() {
54 "use strict"; 54 "use strict";
55 // parse some options from cli 55 // parse some options from cli
56 casper.options.verbose = casper.cli.get('direct') || false;
57 casper.options.logLevel = casper.cli.get('log-level') || "error";
58 if (casper.cli.get('no-colors') === true) { 56 if (casper.cli.get('no-colors') === true) {
59 var cls = 'Dummy'; 57 var cls = 'Dummy';
60 casper.options.colorizerType = cls; 58 casper.options.colorizerType = cls;
......