Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions bin/pscss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ include __DIR__.'/../scss.inc.php';
use Leafo\ScssPhp\Compiler;
use Leafo\ScssPhp\Parser;

$opts = getopt('hvTf:', array('help', 'version'));
$opts = getopt('hvTi:f:', array('help', 'version'));

function has() {
global $opts;
Expand All @@ -34,6 +34,7 @@ Options include:
-v, --version Print the version
-f=format Set the output format (compressed, crunched, expanded, or nested)
-T Dump formatted parse tree
-i=path Set import path

EOT;
exit($HELP);
Expand All @@ -59,8 +60,12 @@ if (has("T")) {

$scss = new Compiler();

if (has("i")) {
$scss->addImportPath($opts["i"]);
}

if (has("f")) {
$scss->setFormatter('Leafo\\ScssPhp\\' . ucfirst($opts["f"]));
$scss->setFormatter('Leafo\\ScssPhp\\Formatter\\' . ucfirst($opts["f"]));
}

echo $scss->compile($data, "STDIN");