leafo/lessphp — pull request #449 by elyobo (2013-07-26 06:26:00+00:00)
Title: Allows variables to be set using the plessc command.

lessphp supports [setting variables from PHP][1], but the `plessc` command doesn't provide a way to do this. This patch adds support for defining variables with the "-d" flag, e.g.

```bash
./plessc -d=foo:bar -d=blarg:w00t style.less
```

can be used to define the *foo* and *blarg* variables with "bar" and "w00t" respectively.

The same caveats as per usual apply to [setting less strings][1]. Note that, because colons are used for splitting the variable name and value, any literal colons should be escaped with a backslash, e.g.

```bash
./plessc -d=foo:bar\\:blarg style.less
# or
./plessc -d='foo:bar\:blarg' style.less
```

If the variable cannot be interpreted correctly (e.g. no colon, or multiple colons, found), then the command invocation will abort with an error.

[1]: http://leafo.net/lessphp/docs/#setting_variables_from_php