/**
  * Copies relevant options from supported sub-commands.
  *
  * @param Application $application An Application instance.
  *
  * @return void
  */
 public function setApplication(Application $application = null)
 {
     parent::setApplication($application);
     // No application is provided, when this command is disabled.
     if (!$application) {
         return;
     }
     $input_definition = $this->getDefinition();
     foreach ($this->getSubCommands() as $sub_command_name) {
         $sub_command = $application->get($sub_command_name);
         assert($sub_command instanceof IAggregatorAwareCommand);
         $copy_options = $sub_command->getAggregatedOptions();
         if (!$copy_options) {
             continue;
         }
         $sub_command_input_definition = $sub_command->getDefinition();
         foreach ($copy_options as $copy_option_name) {
             $copy_option = $sub_command_input_definition->getOption($copy_option_name);
             $input_definition->addOption($copy_option);
         }
     }
 }