Example #1
0
 private function doRun(Console $console)
 {
     $outFile = null;
     if ($console->getArguments()) {
         if ($console->getArguments()[0] == self::INTERACTIVE_MODE) {
             $outFile = $console->getOption('out', null);
             $actionId = $this->selectAction($console);
             $reader = new InteractiveCliParameterReader($this->fields, $console);
             $this->printActionHeader($console, $actionId);
         } else {
             $actionId = $console->getArguments()[0];
             $reader = new CliParameterReader($console);
         }
     } else {
         $this->printUsage($console);
         $this->printActions($console);
         return self::OK;
     }
     $this->registerFields($reader);
     $this->registerRenderers();
     $executor = new Executor($this->actions, $this->fields, $reader, $this->access);
     return $this->printResult($console, $executor->execute($actionId), $outFile);
 }
Example #2
0
 /**
  * @param Parameter $parameter
  * @return mixed The serialized paramater
  */
 public function read(Parameter $parameter)
 {
     return $this->console->getOption($parameter->getName());
 }