[brlcad-commits] SF.net SVN: brlcad:[35539]
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <ra...@us...> - 2009-08-13 22:12:21
|
Revision: 35539 http://brlcad.svn.sourceforge.net/brlcad/?rev=35539&view=rev Author: ralith Date: 2009-08-13 22:12:03 +0000 (Thu, 13 Aug 2009) Log Message: ----------- Fixed command and argument parsing; open appears to now be functional. Modified Paths: -------------- rt^3/trunk/src/g3d/CommandInterpreter.cxx rt^3/trunk/src/g3d/GedCommands.h Modified: rt^3/trunk/src/g3d/CommandInterpreter.cxx =================================================================== --- rt^3/trunk/src/g3d/CommandInterpreter.cxx 2009-08-13 21:56:49 UTC (rev 35538) +++ rt^3/trunk/src/g3d/CommandInterpreter.cxx 2009-08-13 22:12:03 UTC (rev 35539) @@ -52,6 +52,7 @@ // addCommand(new CommandSetPolygonMode()); // addCommand(new CommandSetCameraProjectionType()); // addCommand(new CommandCycleCameraMode()); + addCommand(new CommandGedOpen()); addCommand(new CommandGedDump()); addCommand(new CommandGedSolidsOnRay()); addCommand(new CommandGedSummary()); @@ -139,7 +140,6 @@ // extract the command name QString commandName = args[0]; - args.removeAt(0); if (commandName == "help") { // help meta command @@ -157,8 +157,9 @@ output.append("No such command '" + commandName + "', type 'help' for a list."); } else { // execute the command - emit commandDone(command->execute(args)); + output = command->execute(args); } + emit commandDone(output.size() ? output : "<no output>"); } } Modified: rt^3/trunk/src/g3d/GedCommands.h =================================================================== --- rt^3/trunk/src/g3d/GedCommands.h 2009-08-13 21:56:49 UTC (rev 35538) +++ rt^3/trunk/src/g3d/GedCommands.h 2009-08-13 22:12:03 UTC (rev 35539) @@ -56,7 +56,7 @@ ged* g = GedData::instance().getGED(); int result = 0; - if (args.length() != 1) { + if (args.length() != 2) { return CommandMessages::ONE_ARGUMENT; } else { const char* argv[] = { _name.toStdString().c_str(), args[1].toStdString().c_str() }; @@ -86,7 +86,7 @@ ged* g = GedData::instance().getGED(); int result = 0; - if (args.length() != 1) { + if (args.length() != 2) { return CommandMessages::ONE_ARGUMENT; } else { const char* argv[] = { _name.toStdString().c_str(), args[1].toStdString().c_str() }; @@ -149,7 +149,7 @@ ged* g = GedData::instance().getGED(); int result = 0; - if (args.length() > 1) { + if (args.length() > 2) { return CommandMessages::ZERO_OR_ONE_ARGUMENTS; } else { if (args.length() == 1) { @@ -198,7 +198,7 @@ ged* g = GedData::instance().getGED(); int result = 0; - if (args.length() > 1) { + if (args.length() > 2) { return CommandMessages::ZERO_OR_ONE_ARGUMENTS; } else { if (args.length() == 1) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |