From 6045a6d15738b3104e34cc05a9c5624f3f98bd03 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Mon, 27 Jun 2022 15:13:59 +0200 Subject: Support more verbose error reporting --- src/buildtool/common/cli.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/buildtool/common/cli.hpp') diff --git a/src/buildtool/common/cli.hpp b/src/buildtool/common/cli.hpp index adfa3445..b2bd4576 100644 --- a/src/buildtool/common/cli.hpp +++ b/src/buildtool/common/cli.hpp @@ -12,6 +12,7 @@ #include "fmt/core.h" #include "gsl-lite/gsl-lite.hpp" #include "nlohmann/json.hpp" +#include "src/buildtool/build_engine/expression/evaluator.hpp" #include "src/buildtool/compatibility/compatibility.hpp" #include "src/buildtool/logging/log_level.hpp" @@ -30,6 +31,7 @@ struct CommonArguments { /// \brief Arguments required for analysing targets. struct AnalysisArguments { + std::optional expression_log_limit{}; std::string defines{}; std::filesystem::path config_file{}; std::optional target{}; @@ -137,6 +139,12 @@ static inline auto SetupAnalysisArguments( gsl::not_null const& app, gsl::not_null const& clargs, bool with_graph = true) { + app->add_option("--expression-log-limit", + clargs->expression_log_limit, + fmt::format("Maximal size for logging a single expression " + "in error messages (Default {})", + Evaluator::kDefaultExpressionLogLimit)) + ->type_name("NUM"); app->add_option( "-D,--defines", clargs->defines, -- cgit v1.2.3