registerCommand('#^:set #', $this, 'cmdSet', ':set ', 'set a shell variable'); } /** * register a option * * @param string name of the option * @param object a object handle * @param string method-name of the setor in the object * @param string (unused) */ public function registerOption($option, $obj, $setor, $getor = null) { if (!method_exists($obj, $setor)) { throw new Exception(sprintf("setor %s doesn't exist on class %s", $setor, get_class($obj))); } $this->options[trim($option)] = array("obj" => $obj, "setor" => $setor); } /** * set a shell-var * * :set al to enable autoload * :set bg=dark to enable highlighting with a dark backgroud */ public function cmdSet($l) { if (!preg_match('#:set\s+([a-z]+)\s*(?:=\s*([a-z0-9]+)\s*)?$#i', $l, $a)) { print(':set failed: either :set