SWC-DB  v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
Settings.h
Go to the documentation of this file.
1 /*
2  * SWC-DB© Copyright since 2019 Alex Kashirin <kashirin.alex@gmail.com>
3  * License details at <https://github.com/kashirin-alex/swc-db/#license>
4  */
5 
6 #ifndef swcdb_app_utils_Settings_h
7 #define swcdb_app_utils_Settings_h
8 
11 #include "swcdb/fs/Settings.h"
13 
14 extern "C"{
15 typedef int swcdb_utils_run_t();
17 }
18 
19 
20 namespace SWC {
21 
22 
23 
33 namespace Utils { }
35 
36 
37 
38 namespace Config {
39 
40 
41 void init_app_options(Settings* settings) {
42 
43  init_comm_options(settings);
44  init_client_options(settings);
45  init_fs_options(settings);
46 
47  settings->cmdline_desc
48  .definition(
49  settings->usage_str(
50  "SWC-DB(utils) Usage: %s 'command' [options]\n\nOptions:")
51  )
52  .add_options()
53  ("command,cmd", str("shell"),
54  "Command to execute shell|status|report|custom (1st arg token)")
55  ("command", 1)
56 
57  ("lib-path", str(settings->install_path+"/lib/"),
58  "Path to utilities libraries")
59  ("lib", str(), "Utility-Library of the custom command")
60 
61  ("with-broker", boo(false)->zero_token(),
62  "Query applicable requests with Broker")
63 
64  ("ranger,rgr", "Work with Ranger")
65  ("manager,mngr", "Work with Manager")
66  ("filesystem,fs", "Work with FileSystem type by swc.fs='type'")
67  ("statistics,stats,monit", "Work with Statistics monitor")
68  // default work with DbClient
69  ;
70 
71 }
72 
73 void init_post_cmd_args(Settings* settings) {
74  auto loglevel = settings->get<Property::Value_enum_g>("swc.logging.level");
75  if(loglevel->is_default())
76  loglevel->set(LOG_WARN);
77 }
78 
79 }}
80 
81 #endif // swcdb_app_utils_Settings_h
swcdb_utils_apply_cfg_t
void swcdb_utils_apply_cfg_t(SWC::Env::Config::Ptr env)
Definition: Settings.h:16
Settings.h
SWC::Config::init_app_options
void init_app_options(Settings *settings)
Definition: load_generator.cc:166
Settings.h
SWC::Config::boo
Property::Value_bool::Ptr boo(const bool &v)
Definition: PropertiesParser.cc:21
SWC::Env::Config::Ptr
std::shared_ptr< Config > Ptr
Definition: Settings.h:107
SWC::Config::init_fs_options
void init_fs_options(Settings *settings)
Definition: Settings.cc:13
SWC::Config::init_client_options
void init_client_options(Settings *settings)
Definition: Settings.cc:13
SWC::Config::init_comm_options
void init_comm_options(Settings *settings)
Definition: Settings.cc:13
Settings.h
swcdb_utils_run_t
int swcdb_utils_run_t()
Definition: Settings.h:15
SWC
The SWC-DB C++ namespace 'SWC'.
Definition: main.cc:12
SWC::Config::str
Property::Value_string::Ptr str(std::string &&v)
Definition: PropertiesParser.cc:45
Settings.h
SWC::Config::Property::Value::zero_token
Ptr zero_token() noexcept
Definition: Property.cc:94
SWC::Config::init_post_cmd_args
void init_post_cmd_args(Settings *settings)
Definition: Settings.h:64
SWC::LOG_WARN
@ LOG_WARN
Definition: Logger.h:33