Commit 38748fb0 38748fb03f9c4f338aa3b53fb631dd5214a273bd by mickaelandrieu

Improved CLI Api for verbose mode

1 parent c11a69c5
...@@ -5,7 +5,7 @@ Usage: casperjs [options] script.[js|coffee] [script argument [script argument . ...@@ -5,7 +5,7 @@ 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 8 --verbose Prints log messages to the console
9 --log-level Sets logging level 9 --log-level Sets logging level
10 --help Prints this help 10 --help Prints this help
11 --version Prints out CasperJS version 11 --version Prints out CasperJS version
......
...@@ -91,7 +91,7 @@ Execution results: ...@@ -91,7 +91,7 @@ Execution results:
91 91
92 The `casperjs` command has three available options: 92 The `casperjs` command has three available options:
93 93
94 - ``--direct``: to prints out log messages to the console 94 - ``--verbose``: to prints out log messages to the console
95 - ``--log-level=[debug|info|warning|error]`` to set the :ref:`logging level <logging>` 95 - ``--log-level=[debug|info|warning|error]`` to set the :ref:`logging level <logging>`
96 - ``--engine=[phantomjs|slimerjs]`` to select the browser engine you want to use. CasperJS 96 - ``--engine=[phantomjs|slimerjs]`` to select the browser engine you want to use. CasperJS
97 supports PhantomJS (default) that runs Webkit, and SlimerJS that runs Gecko. 97 supports PhantomJS (default) that runs Webkit, and SlimerJS that runs Gecko.
...@@ -100,7 +100,7 @@ Example: ...@@ -100,7 +100,7 @@ Example:
100 100
101 .. code-block:: text 101 .. code-block:: text
102 102
103 $ casperjs --direct --log-level=debug myscript.js 103 $ casperjs --verbose --log-level=debug myscript.js
104 104
105 Last but not least, you can still use all PhantomJS standard CLI options as you would do with any other phantomjs script: 105 Last but not least, you can still use all PhantomJS standard CLI options as you would do with any other phantomjs script:
106 106
......
...@@ -157,7 +157,7 @@ Options ...@@ -157,7 +157,7 @@ Options
157 Options are prefixed with a double-dash (``--``): 157 Options are prefixed with a double-dash (``--``):
158 158
159 - ``--xunit=<filename>`` will export test suite results in a :ref:`XUnit XML file <xunit_report>` 159 - ``--xunit=<filename>`` will export test suite results in a :ref:`XUnit XML file <xunit_report>`
160 - ``--direct`` will print :doc:`log messages <logging>` directly to the console 160 - ``--verbose`` will print :doc:`log messages <logging>` directly to the console
161 - ``--log-level=<logLevel>`` sets the logging level (see the :doc:`related section <logging>`) 161 - ``--log-level=<logLevel>`` sets the logging level (see the :doc:`related section <logging>`)
162 162
163 .. versionadded:: 1.0 163 .. versionadded:: 1.0
...@@ -176,7 +176,7 @@ Sample custom command: ...@@ -176,7 +176,7 @@ Sample custom command:
176 $ casperjs test --includes=foo.js,bar.js \ 176 $ casperjs test --includes=foo.js,bar.js \
177 --pre=pre-test.js \ 177 --pre=pre-test.js \
178 --post=post-test.js \ 178 --post=post-test.js \
179 --direct \ 179 --verbose \
180 --log-level=debug \ 180 --log-level=debug \
181 --fail-fast \ 181 --fail-fast \
182 test1.js test2.js /path/to/some/test/dir 182 test1.js test2.js /path/to/some/test/dir
......
...@@ -129,7 +129,7 @@ var Casper = function Casper(options) { ...@@ -129,7 +129,7 @@ var Casper = function Casper(options) {
129 // factories 129 // factories
130 this.cli = phantom.casperArgs; 130 this.cli = phantom.casperArgs;
131 this.options.logLevel = this.cli.get('log-level', this.options.logLevel); 131 this.options.logLevel = this.cli.get('log-level', this.options.logLevel);
132 this.options.verbose = this.cli.get('direct', this.options.verbose); 132 this.options.verbose = this.cli.has('verbose');
133 this.colorizer = this.getColorizer(); 133 this.colorizer = this.getColorizer();
134 this.mouse = mouse.create(this); 134 this.mouse = mouse.create(this);
135 this.popups = pagestack.create(); 135 this.popups = pagestack.create();
......