Factorize --list- options handling

This will limit code duplication as more list options will be added.
This commit is contained in:
Romain Vimont
2023-10-24 23:54:56 +02:00
parent c191e9a46e
commit 8c96ab130e
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

@@ -180,7 +180,7 @@ public final class Server {
Ln.initLogLevel(options.getLogLevel());
if (options.getListEncoders() || options.getListDisplays()) {
if (options.getList()) {
if (options.getCleanup()) {
CleanUp.unlinkSelf();
}