Moosh\MooshCommand::processOptions PHP Method

processOptions() public method

public processOptions ( $defaults )
    public function processOptions($defaults)
    {
        foreach ($this->options as $k => $default) {
            if ($this->verbose) {
                echo "Processing command option '{$k}''\n";
            }
            $compiled_options[$k] = $default;
            if ($this->group && isset($defaults[$this->group][$k])) {
                $compiled_options[$k] = $defaults[$this->group][$k];
                if ($this->verbose) {
                    echo "'{$k}' option is set in the RC group defaults '" . $defaults[$this->group][$k] . "'\n";
                }
            }
            if (isset($defaults[$this->group . '-' . $this->name][$k])) {
                $compiled_options[$k] = $defaults[$this->group . '-' . $this->name][$k];
                if ($this->verbose) {
                    echo "'{$k}' option is set in the RC name defaults '" . $defaults[$this->group . '-' . $this->name][$k] . "'\n";
                }
            }
            if ($this->parsedOptions->has($k)) {
                $compiled_options[$k] = $this->parsedOptions[$k]->value;
                if ($this->verbose) {
                    echo "'{$k}' option is set on the command line to '" . $this->parsedOptions[$k]->value . "'\n";
                }
            }
            //we need to remember options before they were expanded
            $this->finalOptions[$k] = $compiled_options[$k];
        }
    }