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/rc.cpp | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/other_tools/just_mr/cli.hpp b/src/other_tools/just_mr/cli.hpp index 130b7611..bcd5302a 100644 --- a/src/other_tools/just_mr/cli.hpp +++ b/src/other_tools/just_mr/cli.hpp @@ -46,6 +46,7 @@ struct MultiRepoCommonArguments { std::optional<std::string> main{std::nullopt}; std::optional<std::filesystem::path> rc_path{std::nullopt}; std::optional<std::filesystem::path> git_path{std::nullopt}; + std::optional<std::filesystem::path> dump_rc{std::nullopt}; bool norc{false}; std::size_t jobs{std::max(1U, std::thread::hardware_concurrency())}; std::vector<std::string> defines{}; @@ -208,6 +209,9 @@ static inline void SetupMultiRepoCommonArguments( fmt::format("Path to the git binary. (Default: {})", kDefaultGitPath)) ->type_name("PATH"); + app->add_option( + "--dump-rc", clargs->dump_rc, "Dump the effective rc value.") + ->type_name("PATH"); app->add_flag("--norc", clargs->norc, "Do not use any just-mrrc file."); app->add_option("-j, --jobs", clargs->jobs, diff --git a/src/other_tools/just_mr/rc.cpp b/src/other_tools/just_mr/rc.cpp index 320efca7..209e4be6 100644 --- a/src/other_tools/just_mr/rc.cpp +++ b/src/other_tools/just_mr/rc.cpp @@ -225,6 +225,14 @@ namespace { } } + // If requested, dump effective rc + if (clargs->common.dump_rc) { + auto dump_json = rc_config.ToJson(); + dump_json.erase("rc files"); + std::ofstream os(*clargs->common.dump_rc); + os << dump_json.dump(2) << std::endl; + } + // read local build root; overwritten if user provided it already if (not clargs->common.just_mr_paths->root) { auto build_root = |