提交 8e2e43e2 编写于 作者: K kailixu

enh: support taosd -u

上级 ab96ac88
......@@ -27,6 +27,7 @@ static void sigintHandler(int32_t signum, void *sigInfo, void *context);
int32_t main(int32_t argc, char *argv[]) {
int dump_config = 0;
int dump_cluster = 0;
// Set global configuration file
for (int32_t i = 1; i < argc; ++i) {
......@@ -61,8 +62,10 @@ int32_t main(int32_t argc, char *argv[]) {
printf("buildinfo: %s\n", buildinfo);
exit(EXIT_SUCCESS);
} else if (strcmp(argv[i], "-k") == 0) {
grantParseParameter();
grantParseParameter(argv[i]);
exit(EXIT_SUCCESS);
} else if (strcmp(argv[i], "-u") == 0) {
dump_cluster = 1;
} else if (strcmp(argv[i], "-A") == 0) {
tsPrintAuth = 1;
}
......@@ -115,6 +118,13 @@ int32_t main(int32_t argc, char *argv[]) {
exit(EXIT_SUCCESS);
}
if (0 != dump_cluster) {
taosInitGlobalCfg();
taosReadGlobalCfg();
grantParseParameter("-u");
exit(EXIT_SUCCESS);
}
if (tsem_init(&exitSem, 0, 0) != 0) {
printf("failed to create exit semphore\n");
exit(EXIT_FAILURE);
......
......@@ -38,7 +38,7 @@ typedef enum {
int32_t grantInit();
void grantCleanUp();
void grantParseParameter();
void grantParseParameter(const char* param);
int32_t grantCheck(EGrantType grant);
void grantReset(EGrantType grant, uint64_t value);
void grantAdd(EGrantType grant, uint64_t value);
......
......@@ -22,7 +22,7 @@
int32_t grantInit() { return TSDB_CODE_SUCCESS; }
void grantCleanUp() {}
void grantParseParameter() { mError("can't parsed parameter k"); }
void grantParseParameter(const char* param) { mError("can't parse parameter %s", param); }
int32_t grantCheck(EGrantType grant) { return TSDB_CODE_SUCCESS; }
void grantReset(EGrantType grant, uint64_t value) {}
void grantAdd(EGrantType grant, uint64_t value) {}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册