initial commit
This commit is contained in:
66
hamrokhaanpaan/wp-content/plugins/ultimo-wp/paradox/vendor/bin/pscss
vendored
Normal file
66
hamrokhaanpaan/wp-content/plugins/ultimo-wp/paradox/vendor/bin/pscss
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
include 'scss.inc.php';
|
||||
|
||||
use Leafo\ScssPhp\Compiler;
|
||||
use Leafo\ScssPhp\Parser;
|
||||
|
||||
$opts = getopt('hvTf:', array('help', 'version'));
|
||||
|
||||
function has() {
|
||||
global $opts;
|
||||
|
||||
foreach (func_get_args() as $arg) {
|
||||
if (isset($opts[$arg])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (has("h", "help")) {
|
||||
$exe = array_shift($argv);
|
||||
|
||||
$HELP = <<<EOT
|
||||
Usage: $exe [options] < input-file
|
||||
|
||||
Options include:
|
||||
|
||||
-h, --help Show this message
|
||||
-v, --version Print the version
|
||||
-f=format Set the output format (compressed, crunched, expanded, or nested)
|
||||
-T Dump formatted parse tree
|
||||
|
||||
EOT;
|
||||
exit($HELP);
|
||||
}
|
||||
|
||||
if (has("v", "version")) {
|
||||
exit(Compiler::$VERSION . "\n");
|
||||
}
|
||||
|
||||
$data = "";
|
||||
|
||||
while (!feof(STDIN)) {
|
||||
$data .= fread(STDIN, 8192);
|
||||
}
|
||||
|
||||
if (has("T")) {
|
||||
$parser = new Parser("STDIN");
|
||||
|
||||
print_r($parser->parse($data));
|
||||
|
||||
exit();
|
||||
}
|
||||
|
||||
$scss = new Compiler();
|
||||
|
||||
if (has("f")) {
|
||||
$scss->setFormatter('Leafo\\ScssPhp\\' . ucfirst($opts["f"]));
|
||||
}
|
||||
|
||||
echo $scss->compile($data, "STDIN");
|
Reference in New Issue
Block a user