mirror of
https://github.com/Genymobile/scrcpy
synced 2025-09-01 14:55:13 +00:00
Extract argument parsing
Move argument parsing to a separate method.
This commit is contained in:
@@ -42,12 +42,17 @@ public class ScrCpyServer {
|
|||||||
}).start();
|
}).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String... args) throws Exception {
|
private static Options createOptions(String... args) {
|
||||||
Options options = new Options();
|
Options options = new Options();
|
||||||
if (args.length > 0) {
|
if (args.length > 0) {
|
||||||
int maximumSize = Integer.parseInt(args[0]) & ~7; // multiple of 8
|
int maximumSize = Integer.parseInt(args[0]) & ~7; // multiple of 8
|
||||||
options.setMaximumSize(maximumSize);
|
options.setMaximumSize(maximumSize);
|
||||||
}
|
}
|
||||||
|
return options;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String... args) throws Exception {
|
||||||
|
Options options = createOptions(args);
|
||||||
try {
|
try {
|
||||||
scrcpy(options);
|
scrcpy(options);
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
|
Reference in New Issue
Block a user