Loading de.ugoe.cs.swe.TTCN3Configuration/src/de/ugoe/cs/swe/common/OptionWithID.java 0 → 100644 +36 −0 Original line number Diff line number Diff line package de.ugoe.cs.swe.common; import org.apache.commons.cli.Option; public class OptionWithID extends Option { private static final long serialVersionUID = -2643329397818768355L; private int id; public OptionWithID(String opt, String longOpt, boolean hasArg, String description) throws IllegalArgumentException { super(opt, longOpt, hasArg, description); } public OptionWithID(String longOpt, boolean hasArg, String description) throws IllegalArgumentException { super(null, longOpt, hasArg, description); } public OptionWithID(int id, String longOpt, boolean hasArg, String description) throws IllegalArgumentException { super(null, longOpt, hasArg, description); this.setId(id); } public OptionWithID(int id, String longOpt, String description) throws IllegalArgumentException { super(null, description); this.setLongOpt(longOpt); this.setId(id); } public void setId(int id) { this.id = id; } public int getId() { return this.id; } } de.ugoe.cs.swe.TTCN3Configuration/src/de/ugoe/cs/swe/common/OptionsHandler.java 0 → 100644 +57 −0 Original line number Diff line number Diff line package de.ugoe.cs.swe.common; import org.apache.commons.cli.Options; public class OptionsHandler { private Options options = new Options(); public OptionsHandler() { this.initialize(); } private void initialize() { OptionWithID optionWithID; optionWithID = new OptionWithID(9, "generate-config", "Generate a new default configuration file at the specified file location"); optionWithID.setArgs(1); optionWithID.setArgName("FILE NAME"); getOptions().addOption(optionWithID); optionWithID = new OptionWithID(10, "config", "Configuration file location\n"); optionWithID.setArgs(1); optionWithID.setArgName("FILE NAME"); // optionWithID.setRequired(true); getOptions().addOption(optionWithID); optionWithID = new OptionWithID(20, "profile", "Configuration profile\n"); optionWithID.setArgs(1); optionWithID.setArgName("PROFILE NAME"); getOptions().addOption(optionWithID); optionWithID = new OptionWithID(30, "verbosity", "Verbosity level (currently supports ERROR, WARNING and INFORMATION values)\n"); optionWithID.setArgs(1); optionWithID.setArgName("LOG LEVEL"); getOptions().addOption(optionWithID); optionWithID = new OptionWithID(40, "output-path", "Destination path for the output (if applicable, otherwise ignored). Overrides the profile setting.\n"); optionWithID.setArgs(1); optionWithID.setArgName("PATH"); getOptions().addOption(optionWithID); optionWithID = new OptionWithID(100, "help", "Show this usage information screen\n"); getOptions().addOption(optionWithID); } public void setOptions(Options options) { this.options = options; } public Options getOptions() { return options; } } No newline at end of file de.ugoe.cs.swe.TTCN3Configuration/src/de/ugoe/cs/swe/common/T3QOptionsHandler.java 0 → 100644 +15 −0 Original line number Diff line number Diff line package de.ugoe.cs.swe.common; public class T3QOptionsHandler extends OptionsHandler { public T3QOptionsHandler() { super(); //this.initializeCustomOptions(); } private void initializeCustomOptions() { OptionWithID optionWithID; optionWithID = new OptionWithID(21, "format", "Apply code formatting\n"); getOptions().addOption(optionWithID); } } Loading
de.ugoe.cs.swe.TTCN3Configuration/src/de/ugoe/cs/swe/common/OptionWithID.java 0 → 100644 +36 −0 Original line number Diff line number Diff line package de.ugoe.cs.swe.common; import org.apache.commons.cli.Option; public class OptionWithID extends Option { private static final long serialVersionUID = -2643329397818768355L; private int id; public OptionWithID(String opt, String longOpt, boolean hasArg, String description) throws IllegalArgumentException { super(opt, longOpt, hasArg, description); } public OptionWithID(String longOpt, boolean hasArg, String description) throws IllegalArgumentException { super(null, longOpt, hasArg, description); } public OptionWithID(int id, String longOpt, boolean hasArg, String description) throws IllegalArgumentException { super(null, longOpt, hasArg, description); this.setId(id); } public OptionWithID(int id, String longOpt, String description) throws IllegalArgumentException { super(null, description); this.setLongOpt(longOpt); this.setId(id); } public void setId(int id) { this.id = id; } public int getId() { return this.id; } }
de.ugoe.cs.swe.TTCN3Configuration/src/de/ugoe/cs/swe/common/OptionsHandler.java 0 → 100644 +57 −0 Original line number Diff line number Diff line package de.ugoe.cs.swe.common; import org.apache.commons.cli.Options; public class OptionsHandler { private Options options = new Options(); public OptionsHandler() { this.initialize(); } private void initialize() { OptionWithID optionWithID; optionWithID = new OptionWithID(9, "generate-config", "Generate a new default configuration file at the specified file location"); optionWithID.setArgs(1); optionWithID.setArgName("FILE NAME"); getOptions().addOption(optionWithID); optionWithID = new OptionWithID(10, "config", "Configuration file location\n"); optionWithID.setArgs(1); optionWithID.setArgName("FILE NAME"); // optionWithID.setRequired(true); getOptions().addOption(optionWithID); optionWithID = new OptionWithID(20, "profile", "Configuration profile\n"); optionWithID.setArgs(1); optionWithID.setArgName("PROFILE NAME"); getOptions().addOption(optionWithID); optionWithID = new OptionWithID(30, "verbosity", "Verbosity level (currently supports ERROR, WARNING and INFORMATION values)\n"); optionWithID.setArgs(1); optionWithID.setArgName("LOG LEVEL"); getOptions().addOption(optionWithID); optionWithID = new OptionWithID(40, "output-path", "Destination path for the output (if applicable, otherwise ignored). Overrides the profile setting.\n"); optionWithID.setArgs(1); optionWithID.setArgName("PATH"); getOptions().addOption(optionWithID); optionWithID = new OptionWithID(100, "help", "Show this usage information screen\n"); getOptions().addOption(optionWithID); } public void setOptions(Options options) { this.options = options; } public Options getOptions() { return options; } } No newline at end of file
de.ugoe.cs.swe.TTCN3Configuration/src/de/ugoe/cs/swe/common/T3QOptionsHandler.java 0 → 100644 +15 −0 Original line number Diff line number Diff line package de.ugoe.cs.swe.common; public class T3QOptionsHandler extends OptionsHandler { public T3QOptionsHandler() { super(); //this.initializeCustomOptions(); } private void initializeCustomOptions() { OptionWithID optionWithID; optionWithID = new OptionWithID(21, "format", "Apply code formatting\n"); getOptions().addOption(optionWithID); } }