Skip to content
This repository has been archived by the owner on Nov 27, 2021. It is now read-only.

Commit

Permalink
Add commandline arguments backtrace & formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
hans-d committed Jul 19, 2012
1 parent 8dc8bcb commit d4358a1
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion extensions/command/Phpspec.php
Expand Up @@ -4,8 +4,27 @@

class Phpspec extends \lithium\console\Command {

/**
* Enable displaying the backtrace on errors
*/
public $backtrace = false;

/**
* Set the format mode
*/
public $formatter = null;

public function run($path) {
$args = (array)$path;
if ($this->formatter === true) {
$this->formatter = false;
};
$args = array(
$path,
$this->backtrace ? '-b' : '',
$this->formatter ? '-f' : '',
$this->formatter ?: '',
);
array_filter($args);
$phpspec = new \PHPSpec\PHPSpec($args);
$phpspec->execute();
}
Expand Down

0 comments on commit d4358a1

Please sign in to comment.