@ClassName: main @Description: TODO @Author: Summer @Date: 2022/2/4 13:20 @Version: v1.0.0 @Description:
| 23 | * @Description: |
| 24 | **/ |
| 25 | public 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected