- Timestamp:
- Aug 27, 2010, 2:41:03 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/consolecommands3/src/libraries/core/command/TclBind.cc
r7219 r7228 134 134 const std::string& command = stripEnclosingBraces(args.get()); 135 135 136 bool success; 137 const std::string& result = CommandExecutor::query(command, &success, false); 138 if (!success) 139 { 140 COUT(1) << "Error: Can't execute command \"" << command << "\"!" << std::endl; 136 int error; 137 const std::string& result = CommandExecutor::query(command, &error, false); 138 switch (error) 139 { 140 case CommandExecutor::Error: COUT(1) << "Error: Can't execute command \"" << command << "\", command doesn't exist. (B)" << std::endl; break; 141 case CommandExecutor::Incomplete: COUT(1) << "Error: Can't execute command \"" << command << "\", not enough arguments given. (B)" << std::endl; break; 142 case CommandExecutor::Deactivated: COUT(1) << "Error: Can't execute command \"" << command << "\", command is not active. (B)" << std::endl; break; 143 case CommandExecutor::Denied: COUT(1) << "Error: Can't execute command \"" << command << "\", access denied. (B)" << std::endl; break; 141 144 } 142 145 … … 149 152 const std::string& command = stripEnclosingBraces(args.get()); 150 153 151 if ( !CommandExecutor::execute(command, false))154 if (CommandExecutor::execute(command, false)) 152 155 { 153 156 COUT(1) << "Error: Can't execute command \"" << command << "\"!" << std::endl; … … 180 183 } 181 184 182 std::string TclBind::eval(const std::string& tclcode, bool* success)183 { 184 if ( success)185 * success = true;185 std::string TclBind::eval(const std::string& tclcode, int* error) 186 { 187 if (error) 188 *error = CommandExecutor::Success; 186 189 187 190 try … … 192 195 { COUT(1) << "Tcl error: " << e.what() << std::endl; } 193 196 194 if ( success)195 * success = false;197 if (error) 198 *error = CommandExecutor::Error; 196 199 return ""; 197 200 }
Note: See TracChangeset
for help on using the changeset viewer.