parse static method

Future<GlobalConfig> parse({
  1. required List<String>? args,
  2. required bool headlessMode,
})

Implementation

static Future<GlobalConfig> parse({
  required List<String>? args,
  required bool headlessMode,
}) async {
  var config = await parseConfigFile();
  Log.d(_kTag, 'parse call parseConfigFile config=$config');

  config = config.merge(parseEnvironment());
  Log.d(_kTag, 'parse call parseEnvironment config=$config');

  if (args != null) {
    config = config.merge(parseArgs(args));
    Log.d(_kTag, 'parse call parseArgs config=$config args=$args');
  }

  if (headlessMode) {
    config = config.merge(parseHeadlessMode());
    Log.d(_kTag, 'parse call parseHeadlessMode config=$config args=$args');
  }

  return config.toConfig();
}