diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2022-06-27 15:13:59 +0200 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2022-06-28 19:30:39 +0200 |
commit | 6045a6d15738b3104e34cc05a9c5624f3f98bd03 (patch) | |
tree | e24979e32191cbfc4c636eaf0e262ec2523552b1 /src/buildtool/common/cli.hpp | |
parent | c29b5de236525b04a852d06d53e76ff341a86fa3 (diff) | |
download | justbuild-6045a6d15738b3104e34cc05a9c5624f3f98bd03.tar.gz |
Support more verbose error reporting
Diffstat (limited to 'src/buildtool/common/cli.hpp')
-rw-r--r-- | src/buildtool/common/cli.hpp | 8 |
1 files changed, 8 insertions, 0 deletions
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<std::size_t> expression_log_limit{}; std::string defines{}; std::filesystem::path config_file{}; std::optional<nlohmann::json> target{}; @@ -137,6 +139,12 @@ static inline auto SetupAnalysisArguments( gsl::not_null<CLI::App*> const& app, gsl::not_null<AnalysisArguments*> 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, |