Пример #1
0
 private function handleArguments()
 {
     $options = getopt('D::H::E::I::A', array('debug::', 'help::', 'exclude::', 'include::', 'all::'));
     foreach ($options as $option => $value) {
         switch ($option) {
             case 'D':
             case 'debug':
                 Utils::log('Debug mode enabled');
                 $this->debugMode = true;
                 break;
             case 'H':
             case 'help':
                 Utils::help();
                 exit;
             case 'E':
             case 'exclude':
                 $this->insertSpecification($value);
                 break;
             case 'I':
             case 'include':
                 $this->insertSpecification($value, false);
                 break;
             case 'A':
             case 'all':
                 Utils::logf('Possible units are: %s', implode(',', $this->units));
                 exit;
         }
     }
     $this->validateUnits();
 }