2
0
mirror of https://github.com/Genymobile/scrcpy synced 2025-08-30 13:58:08 +00:00

Extract argument parsing

Move argument parsing to a separate method.
This commit is contained in:
Romain Vimont
2018-01-31 19:49:49 +01:00
parent 73831a0837
commit 8c4a454d68

View File

@@ -42,12 +42,17 @@ public class ScrCpyServer {
}).start();
}
public static void main(String... args) throws Exception {
private static Options createOptions(String... args) {
Options options = new Options();
if (args.length > 0) {
int maximumSize = Integer.parseInt(args[0]) & ~7; // multiple of 8
options.setMaximumSize(maximumSize);
}
return options;
}
public static void main(String... args) throws Exception {
Options options = createOptions(args);
try {
scrcpy(options);
} catch (Throwable t) {