MCPcopy Create free account
hub / github.com/SatDump/SatDump / main

Function main

src-cli/main.cpp:12–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10#include "project/project.h"
11
12int main(int argc, char *argv[])
13{
14 // Init logger
15 initLogger();
16
17 if (argc < 2)
18 {
19 logger->error("Please specify either live/record or pipeline name!");
20 return 1;
21 }
22
23 if (std::string(argv[1]) == "live")
24 {
25 int ret = main_live(argc, argv);
26 if (ret != 0)
27 return ret;
28 }
29 else if (std::string(argv[1]) == "record")
30 {
31 int ret = main_record(argc, argv);
32 if (ret != 0)
33 return ret;
34 }
35 else if (std::string(argv[1]) == "autotrack")
36 {
37 int ret = main_autotrack(argc, argv);
38 if (ret != 0)
39 return ret;
40 }
41 else if (std::string(argv[1]) == "project")
42 {
43 try
44 {
45 int ret = main_project(argc - 2, argv + 2);
46 if (ret != 0)
47 return ret;
48 }
49 catch (std::exception &e)
50 {
51 logger->error("Error running project! %s", e.what());
52 }
53 }
54 else if (std::string(argv[1]) == "version" || std::string(argv[1]) == "--v")
55 {
56 logger->info("This is SatDump v" + (std::string)SATDUMP_VERSION);
57 return 0;
58 }
59 //////////////
60 else if (std::string(argv[1]) == "sdr_probe")
61 {
62 sdr_probe();
63 }
64 //////////////
65 else
66 {
67 int ret = main_offline(argc, argv);
68 if (ret != 0)
69 return ret;

Callers

nothing calls this directly

Calls 11

initLoggerFunction · 0.85
main_liveFunction · 0.85
main_recordFunction · 0.85
main_autotrackFunction · 0.85
main_projectFunction · 0.85
sdr_probeFunction · 0.85
main_offlineFunction · 0.85
infoMethod · 0.80
stringFunction · 0.50
errorMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected