// $Id: CliExtension.cc 5746 2006-10-05 16:57:09Z m9710797 $ #include "CliExtension.hh" #include "CommandLineParser.hh" #include "MSXMotherBoard.hh" #include "MSXException.hh" #include using std::string; namespace openmsx { CliExtension::CliExtension(CommandLineParser& cmdLineParser_) : cmdLineParser(cmdLineParser_) { cmdLineParser.registerOption("-ext", *this, 7); } bool CliExtension::parseOption(const string& option, std::list& cmdLine) { try { string extensionName = getArgument(option, cmdLine); MSXMotherBoard* motherboard = cmdLineParser.getMotherBoard(); assert(motherboard); motherboard->loadExtension(extensionName); } catch (MSXException& e) { throw FatalError(e.getMessage()); } return true; } const string& CliExtension::optionHelp() const { static string help("Insert the extension specified in argument"); return help; } } // namespace openmsx