-
Notifications
You must be signed in to change notification settings - Fork 247
Expand file tree
/
Copy pathmain.cpp
More file actions
35 lines (29 loc) · 964 Bytes
/
main.cpp
File metadata and controls
35 lines (29 loc) · 964 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "core/cli/cli.h"
#include "core/plugin.h"
#include "init.h"
#include "legacy.h"
#include "logger.h"
#include <memory>
int main(int argc, char *argv[])
{
// Init logger
initLogger();
// Basic flags
bool verbose = satdump::cli::checkVerbose(argc, argv);
// Init SatDump, silent or verbose as requested
if (!verbose)
logger->set_level(slog::LOG_WARN);
satdump::initSatDump();
completeLoggerInit();
if (!verbose)
logger->set_level(slog::LOG_TRACE);
satdump::eventBus->register_handler<satdump::cli::RegisterSubcommandEvent>([](const satdump::cli::RegisterSubcommandEvent &evt)
{ evt.cmd_handlers.push_back(std::make_shared<satdump::LegacyCmdHandler>()); });
satdump::cli::CommandHandler h;
int v = h.parse(argc, argv);
if (v != 0)
return v;
h.run();
satdump::exitSatDump();
return 0;
}