});
handler.registerCommand("sysinfo", new BasicCommand("show info about the MSPSim system", "[-registry] [-config]") {
public int executeCommand(CommandContext context) {
ConfigManager config = (ConfigManager) registry.getComponent("config");
context.out.println("--------- System info ----------\n");
context.out.println("MSPSim version: " + MSP430Constants.VERSION);
context.out.println("Java version : " + System.getProperty("java.version") + " " +
System.getProperty("java.vendor"));
context.out.println("Firmware : " + config.getProperty("firmwareFile", "-"));
context.out.println("AutoloadScript: " + config.getProperty("autoloadScript", "-"));
context.out.println();
if (context.getOption("registry")) {
context.out.println("--------- Registry info --------\n");
registry.printRegistry(context.out);
}
if (context.getOption("config")) {
context.out.println("--------- Configuration ---------\n");
config.print(context.out);
}
return 0;
}
});
handler.registerCommand("quit", new BasicCommand("exit MSPSim", "") {
public int executeCommand(CommandContext context) {
/* TODO: flush all files, etc.... */
System.exit(0);
return 0;
}
});
handler.registerCommand("exit", new BasicCommand("exit MSPSim", "") {
public int executeCommand(CommandContext context) {
System.exit(0);
return 0;
}
});
handler.registerCommand("set", new BasicCommand("set a config parameter", "<parameter> <value>") {
public int executeCommand(CommandContext context) {
ConfigManager config = (ConfigManager) registry.getComponent("config");
config.setProperty(context.getArgument(0), context.getArgument(1));
context.out.println("set " + context.getArgument(0) + " to " + context.getArgument(1));
return 0;
}
});