mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-04-08 08:21:16 -04:00
opt: optimize monitorrule check
This commit is contained in:
parent
dfc940fd5c
commit
2e3c8afe90
1 changed files with 7 additions and 0 deletions
|
|
@ -1778,6 +1778,13 @@ bool parse_option(Config *config, char *key, char *value) {
|
||||||
token = strtok(NULL, ",");
|
token = strtok(NULL, ",");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!rule->name && !rule->make && !rule->model && !rule->serial) {
|
||||||
|
fprintf(stderr, "\033[1m\033[31m[ERROR]:\033[33m Monitor rule "
|
||||||
|
"must have at least one of the following "
|
||||||
|
"options: name, make, model, serial\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
config->monitor_rules_count++;
|
config->monitor_rules_count++;
|
||||||
return !parse_error;
|
return !parse_error;
|
||||||
} else if (strcmp(key, "tagrule") == 0) {
|
} else if (strcmp(key, "tagrule") == 0) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue