Refactor if-block in cli
Several tests must be performed if opts->control is false.
This commit is contained in:
parent
5d6076bffd
commit
ca516f4318
1 changed files with 9 additions and 8 deletions
|
@ -1591,14 +1591,15 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!opts->control && opts->turn_screen_off) {
|
if (!opts->control) {
|
||||||
LOGE("Could not request to turn screen off if control is disabled");
|
if (opts->turn_screen_off) {
|
||||||
return false;
|
LOGE("Could not request to turn screen off if control is disabled");
|
||||||
}
|
return false;
|
||||||
|
}
|
||||||
if (!opts->control && opts->stay_awake) {
|
if (opts->stay_awake) {
|
||||||
LOGE("Could not request to stay awake if control is disabled");
|
LOGE("Could not request to stay awake if control is disabled");
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue