summaryrefslogtreecommitdiff
path: root/src/buildtool/common/cli.hpp
diff options
context:
space:
mode:
authorAlberto Sartori <alberto.sartori@huawei.com>2022-07-27 12:36:49 +0200
committerAlberto Sartori <alberto.sartori@huawei.com>2022-07-27 12:36:49 +0200
commitb45653fac48af05a03a09271959b7f51fdeb5b83 (patch)
tree8f9cab3452bb657f8b2785d0c4b90769311732a1 /src/buildtool/common/cli.hpp
parent719a65d40bb721aa9e089539105a6771a124f58f (diff)
downloadjustbuild-b45653fac48af05a03a09271959b7f51fdeb5b83.tar.gz
install-cas now accepts --log-limit and --log-file
Diffstat (limited to 'src/buildtool/common/cli.hpp')
-rw-r--r--src/buildtool/common/cli.hpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/buildtool/common/cli.hpp b/src/buildtool/common/cli.hpp
index 4e1d86da..a95cac5f 100644
--- a/src/buildtool/common/cli.hpp
+++ b/src/buildtool/common/cli.hpp
@@ -24,8 +24,11 @@ struct CommonArguments {
std::optional<std::filesystem::path> workspace_root{};
std::optional<std::filesystem::path> repository_config{};
std::optional<std::string> main{};
- std::optional<std::filesystem::path> log_file{};
std::size_t jobs{std::max(1U, std::thread::hardware_concurrency())};
+};
+
+struct LogArguments {
+ std::optional<std::filesystem::path> log_file{};
LogLevel log_limit{kDefaultLogLevel};
};
@@ -119,6 +122,11 @@ static inline auto SetupCommonArguments(
clargs->jobs,
"Number of jobs to run (Default: Number of cores).")
->type_name("NUM");
+}
+
+static inline auto SetupLogArguments(
+ gsl::not_null<CLI::App*> const& app,
+ gsl::not_null<LogArguments*> const& clargs) {
app->add_option(
"-f,--log-file", clargs->log_file, "Path to local log file.")
->type_name("PATH");