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-24 23:54:56 +02:00
parent a2fb1b40f6
commit f085765e04
8 changed files with 17 additions and 15 deletions

View File

@@ -153,6 +153,10 @@ public class Options {
return powerOn;
}
public boolean getList() {
return listEncoders || listDisplays;
}
public boolean getListEncoders() {
return listEncoders;
}

View File

@@ -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();
}