public function initializeConfiguration(Input $input) {

    // Initialize configuration objects.
    $config = Robo::config();
    $loader = new YamlConfigLoader();
    $processor = new ConfigProcessor();

    // Extend and import configuration.
    $processor->add($config->export());
    $processor->extend($loader->load('robo.yml.dist'));
    $processor->extend($loader->load($input->getOption('config')));

    // Replace tokens in final configuration file.
    $export = $processor->export();
    // Load configuration with unprocessed tokens just to be able to access
    // the static values as dot chained names.
    $config->import($export);
    array_walk_recursive($export, function (&$value, $key) use ($config) {
      if (is_string($value)) {
        preg_match_all('/![A-Za-z_\-.]+/', $value, $matches);
        foreach ($matches[0] as $match) {
          $config_key = substr($match, 1, strlen($match));
          $value = str_replace($match, $config->get($config_key), $value);
        }
      }
    });
    // Reimport the config, this time with the tokens replaced.
    $config->import($export);

    // Process command line overrides.
    foreach ($input->getOption('override') as $override) {
      $override = (array) Yaml::parse($override);
      $config->set(key($override), array_shift($override));
    }
  }