original_string: public function generate(WorkPackage $work)
      {
          $description = $work->getTaskDescription();
          $command =$description->getCommand();
          if (!$this->isValidCommand($command)) {
              throw new TaskCommandGeneratorException("This command is not usable '{$command}' is not valid");
          }
          $cmd = escapeshellarg($command);
          $cmd .= $this->generateArguments($description);
          $cmd .= $this->generateOptions($description);
          return $cmd;
      }
code: public function generate(WorkPackage $work)
      {
          $description = $work->getTaskDescription();
          $command =$description->getCommand();
          if (!$this->isValidCommand($command)) {
              throw new TaskCommandGeneratorException("This command is not usable '{$command}' is not valid");
          }
          $cmd = escapeshellarg($command);
          $cmd .= $this->generateArguments($description);
          $cmd .= $this->generateOptions($description);
          return $cmd;
      }
code_tokens: public function generate ( WorkPackage $ work ) { $ description = $ work -> getTaskDescription ( ) ; $ command = $ description -> getCommand ( ) ; if ( ! $ this -> isValidCommand ( $ command ) ) { throw new TaskCommandGeneratorException ( "This command is not usable '{$command}' is not valid" ) ; } $ cmd = escapeshellarg ( $ command ) ; $ cmd .= $ this -> generateArguments ( $ description ) ; $ cmd .= $ this -> generateOptions ( $ description ) ; return $ cmd ; }
docstring: Generates a symfony2 console command to execute from the task
  
  @param WorkPackage $work
  @throws TaskCommandGeneratorException
  @return string
docstring_tokens: Generates a symfony2 console command to execute from the task