44 lines
996 B
C++
44 lines
996 B
C++
#include "version.h"
|
|
|
|
#include <iostream>
|
|
#include <string>
|
|
|
|
namespace {
|
|
|
|
bool fail(const std::string& why) {
|
|
std::cerr << "meshnet_worker: FAIL: " << why << std::endl;
|
|
return false;
|
|
}
|
|
|
|
} // namespace
|
|
|
|
int main(int argc, char** argv) {
|
|
bool smoke = argc == 1;
|
|
|
|
for (int i = 1; i < argc; ++i) {
|
|
const std::string arg = argv[i];
|
|
if (arg == "--smoke") {
|
|
smoke = true;
|
|
} else {
|
|
std::cerr << "unknown arg: " << arg << std::endl;
|
|
return 2;
|
|
}
|
|
}
|
|
|
|
if (!smoke) {
|
|
return fail("smoke mode not requested"), 1;
|
|
}
|
|
|
|
if (MESHNET_LLAMA_UPSTREAM_COMMIT[0] == '\0') {
|
|
return fail("upstream commit missing"), 1;
|
|
}
|
|
if (MESHNET_LLAMA_PATCHSET_VERSION[0] == '\0') {
|
|
return fail("patchset version missing"), 1;
|
|
}
|
|
|
|
std::cout << "meshnet worker scaffold ok" << std::endl;
|
|
std::cout << "upstream commit: " << MESHNET_LLAMA_UPSTREAM_COMMIT << std::endl;
|
|
std::cout << "patchset version: " << MESHNET_LLAMA_PATCHSET_VERSION << std::endl;
|
|
return 0;
|
|
}
|