增加命令行查询版本号的功能

This commit is contained in:
luqiuwen
2019-06-22 21:03:33 +08:00
parent aa276e99cf
commit c7ecf01427

View File

@@ -14,6 +14,7 @@
#include <string.h>
#include <errno.h>
#include <pthread.h>
#include <getopt.h>
#include <event2/event.h>
#include <event2/dns.h>
@@ -379,7 +380,21 @@ int main(int argc, char * argv[])
const char * main_profile = "./conf/tfe/tfe.conf";
const char * future_profile= "./conf/tfe/future.conf";
/* adds locking, only required if accessed from separate threads */
int ret = 0;
int opt = 0;
while ((opt = getopt(argc, argv, "v")) != -1)
{
switch (opt)
{
case 'v':
fprintf(stderr, "Tango Frontend Engine, Version: %s\n", tfe_version());
return 0;
default:
break;
}
}
/* adds locking, only required if accessed from separate threads */
evthread_use_pthreads();
unsigned int __log_level = RLOG_LV_INFO;
@@ -402,8 +417,9 @@ int main(int argc, char * argv[])
g_default_proxy = ALLOC(struct tfe_proxy, 1);
assert(g_default_proxy);
strcpy(g_default_proxy->name, "tfe3a");
/* CONFIG */
int ret = tfe_proxy_config(g_default_proxy, main_profile);
ret = tfe_proxy_config(g_default_proxy, main_profile);
CHECK_OR_EXIT(ret == 0, "Failed at loading profile %s, Exit.", main_profile);
/* PERFOMANCE MONITOR */