PHP_CodeSniffer_CLI::processShortArgument PHP Method

processShortArgument() public method

Processes a short (-e) command line argument.
public processShortArgument ( string $arg, integer $pos ) : void
$arg string The command line argument.
$pos integer The position of the argument on the command line.
return void
    public function processShortArgument($arg, $pos)
    {
        switch ($arg) {
            case 'h':
            case '?':
                $this->printUsage();
                exit(0);
            case 'i':
                $this->printInstalledStandards();
                exit(0);
            case 'v':
                if ($this->values['quiet'] === true) {
                    // Ignore when quiet mode is enabled.
                    break;
                }
                if (isset($this->values['verbosity']) === false) {
                    $this->values['verbosity'] = 1;
                } else {
                    $this->values['verbosity']++;
                }
                break;
            case 'l':
                $this->values['local'] = true;
                break;
            case 's':
                $this->values['showSources'] = true;
                break;
            case 'a':
                $this->values['interactive'] = true;
                break;
            case 'e':
                $this->values['explain'] = true;
                break;
            case 'p':
                if ($this->values['quiet'] === true) {
                    // Ignore when quiet mode is enabled.
                    break;
                }
                $this->values['showProgress'] = true;
                break;
            case 'q':
                // Quiet mode disables a few other settings as well.
                $this->values['quiet'] = true;
                $this->values['showProgress'] = false;
                $this->values['verbosity'] = 0;
                break;
            case 'd':
                $ini = explode('=', $this->_cliArgs[$pos + 1]);
                $this->_cliArgs[$pos + 1] = '';
                if (isset($ini[1]) === true) {
                    ini_set($ini[0], $ini[1]);
                } else {
                    ini_set($ini[0], true);
                }
                break;
            case 'n':
                $this->values['warningSeverity'] = 0;
                break;
            case 'w':
                $this->values['warningSeverity'] = null;
                break;
            default:
                if ($this->dieOnUnknownArg === false) {
                    $this->values[$arg] = $arg;
                } else {
                    $this->processUnknownArgument('-' . $arg, $pos);
                }
        }
        //end switch
    }