diff options
author | Alberto Sartori <alberto.sartori@huawei.com> | 2022-07-27 12:36:49 +0200 |
---|---|---|
committer | Alberto Sartori <alberto.sartori@huawei.com> | 2022-07-27 12:36:49 +0200 |
commit | b45653fac48af05a03a09271959b7f51fdeb5b83 (patch) | |
tree | 8f9cab3452bb657f8b2785d0c4b90769311732a1 /src/buildtool/common/cli.hpp | |
parent | 719a65d40bb721aa9e089539105a6771a124f58f (diff) | |
download | justbuild-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.hpp | 10 |
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"); |