| 896 | } |
| 897 | |
| 898 | private static class Context implements Callable<Integer> |
| 899 | { |
| 900 | private Options options; |
| 901 | |
| 902 | private Context(Options options) |
| 903 | { |
| 904 | this.options = options; |
| 905 | } |
| 906 | |
| 907 | @Override |
| 908 | public Integer call() |
| 909 | { |
| 910 | if (options.gui) |
| 911 | { |
| 912 | try { |
| 913 | DoomToolsGUIMain.startGUIAppProcess(ApplicationNames.WADSCRIPT); |
| 914 | } catch (IOException e) { |
| 915 | options.stderr.println("ERROR: Could not start WadScript GUI!"); |
| 916 | return ERROR_IOERROR; |
| 917 | } |
| 918 | return ERROR_NONE; |
| 919 | } |
| 920 | |
| 921 | if (options.changelog) |
| 922 | { |
| 923 | changelog(options.stdout, "wadscript"); |
| 924 | return ERROR_NONE; |
| 925 | } |
| 926 | |
| 927 | if (options.mode == null) |
| 928 | { |
| 929 | splash(options.stdout); |
| 930 | return ERROR_NONE; |
| 931 | } |
| 932 | |
| 933 | if (options.mode == Mode.VERSION) |
| 934 | { |
| 935 | splash(options.stdout); |
| 936 | return ERROR_NONE; |
| 937 | } |
| 938 | |
| 939 | if (options.mode == Mode.HELP) |
| 940 | { |
| 941 | splash(options.stdout); |
| 942 | usage(options.stdout); |
| 943 | printHelp(options.stdout); |
| 944 | return ERROR_NONE; |
| 945 | } |
| 946 | |
| 947 | if (options.mode == Mode.FUNCTIONHELP) |
| 948 | { |
| 949 | try { |
| 950 | printFunctionHelp(new UsageTextRenderer(options.stdout), options.resolvers); |
| 951 | return ERROR_NONE; |
| 952 | } catch (IOException e) { |
| 953 | options.stderr.println("ERROR: " + e.getLocalizedMessage()); |
| 954 | return ERROR_IOERROR; |
| 955 | } catch (Exception e) { |
nothing calls this directly
no outgoing calls
no test coverage detected