function drush_init_annotation_commands

master preflight.inc drush_init_annotation_commands($container)
1 call to drush_init_annotation_commands()
drush_preflight_prepare in includes/preflight.inc
Prepare Drush for preflight.

File

includes/preflight.inc, line 365
Preflight, postflight and shutdown code.

Code

function drush_init_annotation_commands($container) {
  $application = $container->get('application');
  /** @var \Consolidation\AnnotatedCommand\CommandFileDiscovery */
  $discovery = $container->get('commandDiscovery');
  $commandFiles = $discovery->discover(DRUSH_BASE_PATH . '/lib/Drush', '\Drush');
  $base_class = Path::join(DRUSH_BASE_PATH, 'lib/Drush/CommandFiles/DrushCommands.php');
  unset($commandFiles[$base_class]);
  drush_init_register_command_files($container, $commandFiles);
}