From e9d362faea52e39e8f51b3bb53dcc94b96841474 Mon Sep 17 00:00:00 2001 From: Oliver Reiche Date: Thu, 2 Jun 2022 16:47:11 +0200 Subject: CLI: New option -D/--defines for in-line configuration --- src/buildtool/common/cli.hpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/buildtool/common/cli.hpp') diff --git a/src/buildtool/common/cli.hpp b/src/buildtool/common/cli.hpp index 17ebd3f0..fdfb08b9 100644 --- a/src/buildtool/common/cli.hpp +++ b/src/buildtool/common/cli.hpp @@ -30,6 +30,7 @@ struct CommonArguments { /// \brief Arguments required for analysing targets. struct AnalysisArguments { + std::string defines{}; std::filesystem::path config_file{}; std::optional target{}; std::optional target_file_name{}; @@ -136,6 +137,12 @@ static inline auto SetupAnalysisArguments( gsl::not_null const& app, gsl::not_null const& clargs, bool with_graph = true) { + app->add_option( + "-D,--defines", + clargs->defines, + "Define configuration variables via an in-line JSON object.\n" + "Latest wins. Supersedes values provided via --config") + ->type_name("JSON"); app->add_option( "-c,--config", clargs->config_file, "Path to configuration file.") ->type_name("PATH"); -- cgit v1.2.3