Factorize --list- options handling

This will limit code duplication as more list options will be added.

PR #4213 <https://github.com/Genymobile/scrcpy/pull/4213>
This commit is contained in:
Romain Vimont
2023-10-31 12:45:40 +01:00
parent a2fb1b40f6
commit f085765e04
8 changed files with 17 additions and 15 deletions
@@ -153,6 +153,10 @@ public class Options {
return powerOn;
}
public boolean getList() {
return listEncoders || listDisplays;
}
public boolean getListEncoders() {
return listEncoders;
}
@@ -195,7 +195,7 @@ public final class Server {
Ln.initLogLevel(options.getLogLevel());
if (options.getListEncoders() || options.getListDisplays()) {
if (options.getList()) {
if (options.getCleanup()) {
CleanUp.unlinkSelf();
}