MCPcopy Create free account
hub / github.com/OSSystems/EasySplash / main

Function main

src/main.cpp:60–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58
59
60int main(int argc, char *argv[])
61{
62 bool non_realtime = false;
63 char const * const short_options = "hi:l:v:n";
64 struct option const long_options[] = {
65 { "help", 0, NULL, 'h' },
66 { "zipfile", 1, NULL, 'i' },
67 { "loglevel", 1, NULL, 'v' },
68 { "non-realtime", 0, NULL, 'n' },
69 { NULL, 0, NULL, 0 }
70 };
71 int next_option;
72 std::string zipfilename, loglevel;
73
74 while (true)
75 {
76 next_option = getopt_long(argc, argv, short_options, long_options, NULL);
77
78 if (next_option == -1)
79 break;
80
81 switch (next_option)
82 {
83 case 'h':
84 print_usage(argv[0]);
85 return 0;
86
87 case 'i':
88 zipfilename = optarg;
89 break;
90
91 case 'v':
92 loglevel = optarg;
93 break;
94
95 case 'n':
96 non_realtime = true;
97 break;
98 }
99 }
100
101
102 using namespace easysplash;
103
104
105 if (loglevel == "trace")
106 set_min_log_level(log_level_trace);
107 else if (loglevel == "debug")
108 set_min_log_level(log_level_debug);
109 else if (loglevel == "info")
110 set_min_log_level(log_level_info);
111 else if (loglevel == "warning")
112 set_min_log_level(log_level_trace);
113 else if (loglevel == "error")
114 set_min_log_level(log_level_error);
115
116 if (getpid() == 1)
117 {

Callers

nothing calls this directly

Calls 6

print_usageFunction · 0.85
set_min_log_levelFunction · 0.85
runMethod · 0.80
is_validFunction · 0.70
is_validMethod · 0.45
get_widthMethod · 0.45

Tested by

no test coverage detected