addConfigArgument method

void addConfigArgument(
  1. String configArgument
)

Add a single config value by using the command line syntax. This is usually used for command line argument parsing.

Syntax: path.to.value=value

You can modify config values by adding an argument to the run command like this: dart service.dart --path.to.value=value

Config values and files override each other in the order they are provided as arguments.

TODO escape sequences

Implementation

void addConfigArgument(String configArgument) {
  final splitPoint = configArgument.indexOf('=');
  if (splitPoint > 0) {
    final path = ConfigPath(configArgument.substring(0, splitPoint));
    final value = configArgument.substring(splitPoint + 1);
    _merge(_configMap, _singleValueAsMap(path, value));
  } else {
    _log.error('Invalid command line argument "$configArgument".');
  }
}