public function configure(ConfigProviderInterface $cfg)
  {
    if($this->_configured)
    {
      return $this;
    }

    try
    {
      $config = $cfg->getSection('console');
      $commands = $config->getItem('commands', []);
      $patterns = $config->getItem('patterns', []);
    }
    catch(\Throwable $e)
    {
      $commands = $patterns = [];
    }

    $this->_searchPatterns = array_merge($this->_searchPatterns, $patterns);

    foreach($commands as $name => $class)
    {
      $command = $this->getCommandByString($class);
      if($command !== null)
      {
        if(!is_int($name))
        {
          $command->setName($name);
        }
        $this->add($command);
      }
    }

    $this->_configured = true;
    return $this;
  }