This repository was archived by the owner on Oct 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmain.cpp
More file actions
31 lines (28 loc) · 969 Bytes
/
main.cpp
File metadata and controls
31 lines (28 loc) · 969 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
#include "sandbox/main.hpp"
#include "server/main.hpp"
#include "util/daemon.hpp"
#include "util/flags.hpp"
#include "util/misc.hpp"
#include "util/version.hpp"
#include "worker/main.hpp"
class TaskMakerMain {
public:
// NOLINTNEXTLINE(google-runtime-references)
explicit TaskMakerMain(kj::ProcessContext& context)
: context(context), wm(&context), sm(&context), bm(&context) {}
kj::MainFunc getMain() {
static std::string version = "Task-Maker (" + util::version + ")";
return kj::MainBuilder(context, version, "The new cmsMake!")
.addSubCommand("worker", KJ_BIND_METHOD(wm, getMain), "run the worker")
.addSubCommand("server", KJ_BIND_METHOD(sm, getMain), "run the server")
.addSubCommand("sandbox", KJ_BIND_METHOD(bm, getMain),
"run the sandbox")
.build();
}
private:
kj::ProcessContext& context;
worker::Main wm;
server::Main sm;
sandbox::Main bm;
};
KJ_MAIN(TaskMakerMain);