OGS
TCLAPArguments.h
Go to the documentation of this file.
1
9#pragma once
10
11#include <tclap/CmdLine.h>
12
13#include <memory>
14#include <vector>
15
16namespace BaseLib
17{
18
19inline std::unique_ptr<TCLAP::ValueArg<std::string>> makeLogLevelArg()
20{
21 static std::vector<std::string> allowed_log_levels{"none", "error", "warn",
22 "info", "debug", "all"};
23 static auto* allowed_log_levels_vals =
24 new TCLAP::ValuesConstraint<std::string>(allowed_log_levels);
25
26 return std::make_unique<TCLAP::ValueArg<std::string>>(
27 "l", "log-level", "the verbosity of logging messages", false,
28#ifdef NDEBUG
29 "info",
30#else
31 "all",
32#endif
33 allowed_log_levels_vals);
34}
35
36} // namespace BaseLib
std::unique_ptr< TCLAP::ValueArg< std::string > > makeLogLevelArg()