|
@@ -41,6 +41,10 @@ import de.mcs.tools.sps.exceptions.SyntaxError;
|
|
|
import de.mcs.tools.sps.mnemonic.JMP;
|
|
|
import de.mcs.tools.sps.mnemonic.Mnemonic;
|
|
|
import de.mcs.tools.sps.mnemonic.MnemonicFactory;
|
|
|
+import de.mcs.utils.jsap.FileOption;
|
|
|
+import de.mcs.utils.jsap.ProcessCommandline;
|
|
|
+import de.mcs.utils.jsap.StringOption;
|
|
|
+import de.mcs.utils.jsap.Switch;
|
|
|
|
|
|
/**
|
|
|
* @author wklaa_000
|
|
@@ -63,11 +67,31 @@ public class SPSAssembler {
|
|
|
// TODO Auto-generated constructor stub
|
|
|
}
|
|
|
|
|
|
+ @Switch(shortKey = 'h', longKey = "help", name = "help", help = "show this help page", required = false, defaultValue = false)
|
|
|
+ public static void doHelp(boolean value) {
|
|
|
+ if (value) {
|
|
|
+ ProcessCommandline.showHelp("usage");
|
|
|
+ System.exit(0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @StringOption(shortKey = 'd', longKey = "destination", name = "destination system", defaultValue = "HOLTEK", help = "the destination system to compile to.", required = false)
|
|
|
+ public static void setDestinationSystemFile(String destination) {
|
|
|
+ System.out.printf("set destination %s\r\n", destination);
|
|
|
+ }
|
|
|
+
|
|
|
+ @FileOption(index = 1, name = "source file", help = "source file to compile", required = false)
|
|
|
+ public static void setSourceFile(File sourceFile) {
|
|
|
+ System.out.printf("set source to: %s\r\n", sourceFile);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* @param args
|
|
|
* @throws IOException
|
|
|
*/
|
|
|
public static void main(String[] args) throws IOException, SyntaxError {
|
|
|
+ ProcessCommandline.processCommandline(args);
|
|
|
+
|
|
|
if (args.length == 0) {
|
|
|
showHelp();
|
|
|
}
|