protected function setOptionsForLastCommand() {
    if (isset($this->commands)) {
      $numberOfCommands = count($this->commands);
      $correspondingCommand = $numberOfCommands - 1;
      $this->options[$correspondingCommand] = $this->arguments;
      $this->arguments = '';
    }
    elseif (isset($this->arguments) && !empty($this->arguments)) {
      throw new TaskException($this, "A drush command must be added to the stack before setting arguments: {$this->arguments}");
    }
  }