forked from tronprotocol/java-tron
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArgs.java
More file actions
51 lines (38 loc) · 1.12 KB
/
Args.java
File metadata and controls
51 lines (38 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package org.tron.program;
import com.beust.jcommander.JCommander;
import com.beust.jcommander.Parameter;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
public class Args {
private final static Args INSTANCE = new Args();
@Parameter(names = {"-d", "--output-directory"}, description = "Directory")
private String outputDirectory = new String("");
@Parameter(names = {"-h", "--help"}, help = true, description = "Directory")
private boolean help = false;
@Parameter(description = "-seed-nodes")
private List<String> seedNodes = new ArrayList<>();
private Args() {
}
public static void setParam(String[] args) {
JCommander.newBuilder()
.addObject(INSTANCE)
.build()
.parse(args);
}
public static Args getInstance() {
return INSTANCE;
}
public String getOutputDirectory() {
if (outputDirectory != "" && !outputDirectory.endsWith(File.separator)) {
return outputDirectory + File.separator;
}
return outputDirectory;
}
public boolean isHelp() {
return help;
}
public List<String> getSeedNodes() {
return seedNodes;
}
}