Files
phxrpc/codegen/codegen.cpp
tqcq f1ac87c160
All checks were successful
phxrpc / build (Debug, aarch64-linux-gnu) (push) Successful in 3m57s
phxrpc / build (Debug, host.gcc) (push) Successful in 4m0s
phxrpc / build (Debug, mipsel-linux-gnu) (push) Successful in 5m7s
phxrpc / build (Debug, arm-linux-gnueabihf) (push) Successful in 28m44s
phxrpc / build (Release, aarch64-linux-gnu) (push) Successful in 3m59s
phxrpc / build (Release, host.gcc) (push) Successful in 4m46s
phxrpc / build (Release, mipsel-linux-gnu) (push) Successful in 3m26s
phxrpc / build (Release, arm-linux-gnueabihf) (push) Successful in 9m11s
init repo.
2025-08-06 16:06:13 +08:00

49 lines
1.1 KiB
C++

#include "codegen.h"
#include <stdio.h>
#include <string>
#include <vector>
static void
PrintHelp(const char *program)
{
printf("\n");
printf("PhxRPC ProtoBuf CodeGenerator\n");
printf("\n");
printf("Subcommand:\n");
printf(" client:\n");
printf(" server:\n");
printf(" service:\n");
printf(" tool:\n");
return;
}
int
main(int argc, char **argv)
{
if (argc == 1) {
PrintHelp(argv[0]);
} else {
std::vector<char *> args;
for (int i = 0; i < argc; i++) {
if (i == 1) {// skip subcommmand
continue;
}
args.push_back(argv[i]);
}
std::string subcommand = argv[1];
if (subcommand == "client") {
client_main(argc - 1, args.data());
} else if (subcommand == "server") {
server_main(argc - 1, args.data());
} else if (subcommand == "service") {
service_main(argc - 1, args.data());
} else if (subcommand == "tool") {
tool_main(argc - 1, args.data());
} else {
PrintHelp(argv[0]);
}
}
return 0;
}