diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/other_tools/just_mr/cli.hpp | 4 | ||||
-rw-r--r-- | src/other_tools/just_mr/main.cpp | 29 |
2 files changed, 30 insertions, 3 deletions
diff --git a/src/other_tools/just_mr/cli.hpp b/src/other_tools/just_mr/cli.hpp index 01622980..8b5604a6 100644 --- a/src/other_tools/just_mr/cli.hpp +++ b/src/other_tools/just_mr/cli.hpp @@ -109,9 +109,7 @@ static inline void SetupMultiRepoCommonArguments( }, "JSON array with the list of strings representing the launcher to " "prepend actions' commands before being executed locally.") - ->type_name("JSON") - ->run_callback_for_default() - ->default_val(nlohmann::json(kDefaultLauncher).dump()); + ->type_name("JSON"); app->add_option_function<std::string>( "--distdir", [clargs](auto const& distdir_raw) { diff --git a/src/other_tools/just_mr/main.cpp b/src/other_tools/just_mr/main.cpp index 965c3bf0..0657c84c 100644 --- a/src/other_tools/just_mr/main.cpp +++ b/src/other_tools/just_mr/main.cpp @@ -387,6 +387,35 @@ void SetupLogging(MultiRepoLogArguments const& clargs) { clargs->just_cmd.just_args[cmd_name] = std::move(args); } } + // read default for local launcher + if (not clargs->common.local_launcher) { + auto launcher = rc_config["local launcher"]; + if (launcher.IsNotNull()) { + if (not launcher->IsList()) { + Logger::Log(LogLevel::Error, + "Configuration-file provided launcher {} is not a " + "list of strings", + launcher->ToString()); + std::exit(kExitConfigError); + } + std::vector<std::string> default_launcher{}; + default_launcher.reserve(launcher->List().size()); + for (auto const& entry : launcher->List()) { + if (not entry->IsString()) { + Logger::Log(LogLevel::Error, + "Configuration-file provided launcher {} is " + "not a list of strings", + launcher->ToString()); + std::exit(kExitConfigError); + } + default_launcher.emplace_back(entry->String()); + } + clargs->common.local_launcher = default_launcher; + } + else { + clargs->common.local_launcher = kDefaultLauncher; + } + } // read config lookup order auto config_lookup_order = rc_config["config lookup order"]; if (config_lookup_order.IsNotNull()) { |