private void processExtendedEquipmentDb() throws ParseException { String filename; if (getToken() == TOK_LITERAL) { filename = getTokenValue(); nextToken(); megamek.common.EquipmentType .writeEquipmentExtendedDatabase(new File(filename)); } else { error("file name expected"); //$NON-NLS-1$ } System.exit(0); }
private void processRestOfInput() { Vector<String> v = new Vector<String>(); while (getArgValue() != null) { v.addElement(getArgValue()); nextArg(); } setToken(TOK_EOF); setTokenValue(null); restArgs = v.toArray(new String[0]); } }
@SuppressWarnings("nls") private void processUnitExporter(boolean officialUnitList) { String filename; if ((getToken() == TOK_LITERAL) || officialUnitList) { if (officialUnitList) { filename = MechFileParser.FILENAME_OFFICIAL_UNITS; } else { filename = getTokenValue(); nextToken();
if (getToken() == TOK_LITERAL) { filename = getTokenValue(); nextToken(); MechSummary ms = MechSummaryCache.getInstance().getMech( filename); } catch (Exception ex) { error("\"chassis model\" expected as input"); //$NON-NLS-1$ error("\"chassis model\" expected as input"); //$NON-NLS-1$
if ((getToken() == TOK_OPTION) && getTokenValue().equals(OPTION_LOG)) { nextToken(); parseLog(); if ((getToken() == TOK_OPTION) && getTokenValue().equals(OPTION_EQUIPMENT_DB)) { nextToken(); processEquipmentDb(); if ((getToken() == TOK_OPTION) && getTokenValue().equals(OPTION_EQUIPMENT_EXTENDED_DB)) { nextToken(); processExtendedEquipmentDb(); if ((getToken() == TOK_OPTION) && getTokenValue().equals(OPTION_DATADIR)) { nextToken(); processDataDir(); if ((getToken() == TOK_OPTION) && getTokenValue().equals(OPTION_UNIT_VALIDATOR)) { nextToken(); processUnitValidator(); if ((getToken() == TOK_OPTION) && getTokenValue().equals(OPTION_UNIT_EXPORT)) { nextToken(); processUnitExporter();
private void processUnitAlphaStrikeConverter() { if (getToken() == TOK_LITERAL) { filename = getTokenValue(); nextToken();
private void processUnitBattleForceConverter() { if (getToken() == TOK_LITERAL) { filename = getTokenValue(); nextToken();
CommandLineParser cp = new CommandLineParser(args); cp.parse(); String lf = cp.getLogFilename(); if (lf != null) { if (lf.equals("none") || lf.equals("off")) { //$NON-NLS-1$ //$NON-NLS-2$ String[] restArgs = cp.getRestArgs(); if (cp.dedicatedServer()) { MegaMek.startDedicatedServer(restArgs); } else { String interfaceName = cp.getGuiName(); if (interfaceName == null) { interfaceName = PreferenceManager.getClientPreferences()
private void parseLog() throws ParseException { if (getToken() == TOK_LITERAL) { logFilename = getTokenValue(); nextToken(); } else { error("log file name expected"); //$NON-NLS-1$ } }
private void parseGUI() throws ParseException { if (getToken() == TOK_LITERAL) { guiName = getTokenValue(); nextToken(); } else { error("GUI name expected"); //$NON-NLS-1$ } }
private void processDataDir() throws ParseException { String dataDirName; if (getToken() == TOK_LITERAL) { dataDirName = getTokenValue(); nextToken(); Configuration.setDataDir(new File(dataDirName)); } else { error("directory name expected"); // $NON-NLS-1$ } }
private void processEquipmentDb() throws ParseException { String filename; if (getToken() == TOK_LITERAL) { filename = getTokenValue(); nextToken(); megamek.common.EquipmentType.writeEquipmentDatabase(new File( filename)); } else { error("file name expected"); //$NON-NLS-1$ } System.exit(0); }