WeChatFerry/wcf/main.cpp

31 lines
588 B
C++
Raw Normal View History

2023-02-25 01:53:02 +08:00
#include <stdio.h>
#include <string.h>
2023-02-25 02:11:04 +08:00
#include "framework.h"
#include "log.h"
2023-02-25 01:53:02 +08:00
#include "sdk.h"
2023-02-25 02:11:04 +08:00
void help() { LOG_INFO("Usage: wcf.exe start|stop [debug]\n"); }
2023-02-25 01:53:02 +08:00
int main(int argc, char *argv[])
{
int ret = -1;
bool debug = false;
2023-02-25 02:11:04 +08:00
2023-02-25 01:53:02 +08:00
if ((argc < 2) || (argc > 3)) {
help();
} else if (argc == 3) {
debug = (strcmp(argv[2], "debug") == 0);
}
if (strcmp(argv[1], "start") == 0) {
ret = WxInitSDK(debug);
} else if (strcmp(argv[1], "stop") == 0) {
ret = WxDestroySDK();
} else {
help();
}
return ret;
}