MCPcopy Create free account
hub / github.com/SummerSec/SPATool / main

Class main

src/main/java/com/sumsec/ui/main.java:25–78  ·  view source on GitHub ↗

@ClassName: main @Description: TODO @Author: Summer @Date: 2022/2/4 13:20 @Version: v1.0.0 @Description:

Source from the content-addressed store, hash-verified

23 * @Description:
24 **/
25public class main extends Application {
26 private static Options OPTIONS = new Options();
27 private static CommandLine commandLine;
28 private static String HELP_STRING = null;
29 private static Logger logger = LogManager.getLogger(main.class);
30
31 public static void main(String[] args) {
32 if (args.length == 0) {
33 logger.info("No arguments provided");
34 logger.info("Starting application with default arguments");
35 launch(args);
36 }else{
37 for (String arg : args) {
38 logger.info(arg);
39 }
40 initCliArgs(args);
41 }
42 }
43
44 @Override
45 public void start(Stage primaryStage) throws Exception {
46 Parent root = FXMLLoader.load(getClass().getResource("/gui.fxml"));
47 primaryStage.setTitle("Static Analysis Tool "+ ConstatField.version + " by SummerSec");
48 Image icon = new Image(String.valueOf(getClass().getResource("/icon.png")));
49 primaryStage.getIcons().add(icon);
50 Scene scene = new Scene(root);
51 primaryStage.setScene(scene);
52 primaryStage.show();
53 logger.info("Application started");
54
55
56 }
57 public main(){}
58 private static void initCliArgs(String[] args) {
59 CommandLineParser parser = new org.apache.commons.cli.DefaultParser();
60
61 OPTIONS.addOption("h", "help", false, "Print this help message");
62 OPTIONS.addOption("v", "version", false, "Print the version information and exit");
63 OPTIONS.addOption("d", "debug", false, "Enable debug mode");
64
65 try {
66 commandLine = parser.parse(OPTIONS, args);
67 if (commandLine.hasOption("h")) {
68
69 }
70 }catch (Exception e) {
71
72 e.printStackTrace();
73 }
74
75 }
76
77
78}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected