mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-02-26 01:40:18 -05:00
opt: optimize monitorrule check
This commit is contained in:
parent
cbc344ab88
commit
4787402b12
1 changed files with 7 additions and 0 deletions
|
|
@ -1844,6 +1844,13 @@ bool parse_option(Config *config, char *key, char *value) {
|
|||
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++;
|
||||
return !parse_error;
|
||||
} else if (strcmp(key, "tagrule") == 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue