Skip to content

Commit b65729d

Browse files
committed
Merge pull request leafo#213 from etu/master
Fixed namespace of Formatters and added option for Import Path
2 parents 9bcad02 + 8b36650 commit b65729d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

bin/pscss

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ include __DIR__.'/../scss.inc.php';
88
use Leafo\ScssPhp\Compiler;
99
use Leafo\ScssPhp\Parser;
1010

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

1313
function has() {
1414
global $opts;
@@ -34,6 +34,7 @@ Options include:
3434
-v, --version Print the version
3535
-f=format Set the output format (compressed, crunched, expanded, or nested)
3636
-T Dump formatted parse tree
37+
-i=path Set import path
3738
3839
EOT;
3940
exit($HELP);
@@ -59,8 +60,12 @@ if (has("T")) {
5960

6061
$scss = new Compiler();
6162

63+
if (has("i")) {
64+
$scss->addImportPath($opts["i"]);
65+
}
66+
6267
if (has("f")) {
63-
$scss->setFormatter('Leafo\\ScssPhp\\' . ucfirst($opts["f"]));
68+
$scss->setFormatter('Leafo\\ScssPhp\\Formatter\\' . ucfirst($opts["f"]));
6469
}
6570

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

0 commit comments

Comments
 (0)