public function do_option($opt, $value)
 {
     switch ($opt) {
         case 'dry-run':
             $this->verbose = true;
             $this->nowrite = true;
             $this->dryrun = true;
             $this->trace = true;
             break;
         case 'help':
             $this->help();
             exit;
         case 'libdir':
             set_include_path($value . PATH_SEPARATOR . get_include_path());
             break;
         case 'nosearch':
             $this->nosearch = true;
             break;
         case 'prereqs':
             $this->show_prereqs = true;
             break;
         case 'quiet':
             $this->verbose = false;
             break;
         case 'pakefile':
             pakeApp::$PAKEFILES = array($value);
             break;
         case 'require':
             require $value;
             break;
         case 'tasks':
             $this->show_tasks = true;
             break;
         case 'trace':
             $this->trace = true;
             $this->verbose = true;
             break;
         case 'usage':
             $this->usage();
             exit;
         case 'verbose':
             $this->verbose = true;
             break;
         case 'version':
             echo sprintf('pake version %s', pakeColor::colorize(pakeApp::VERSION, 'INFO')) . "\n";
             exit;
         default:
             throw new pakeException(sprintf("Unknown option: %s", $opt));
     }
 }
예제 #2
0
 public function do_option($opt, $value)
 {
     switch ($opt) {
         case 'interactive':
             $this->interactive = true;
             break;
         case 'dry-run':
             $this->verbose = true;
             $this->nowrite = true;
             $this->dryrun = true;
             $this->trace = true;
             break;
         case 'help':
             $this->help();
             exit;
         case 'libdir':
             set_include_path($value . PATH_SEPARATOR . get_include_path());
             break;
         case 'nosearch':
             $this->nosearch = true;
             break;
         case 'prereqs':
             $this->show_prereqs = true;
             break;
         case 'quiet':
             $this->verbose = false;
             break;
         case 'pakefile':
             self::$PAKEFILES = array($value);
             break;
         case 'require':
             require $value;
             break;
         case 'import':
             pake_import($value);
             break;
         case 'tasks':
             $this->show_tasks = true;
             break;
         case 'trace':
             $this->trace = true;
             $this->verbose = true;
             break;
         case 'usage':
             $this->usage();
             exit;
         case 'verbose':
             $this->verbose = true;
             break;
         case 'force-tty':
             define('PAKE_FORCE_TTY', true);
             break;
         case 'version':
             $this->showVersion();
             exit;
         default:
             throw new pakeException(sprintf("Unknown option: %s", $opt));
     }
 }