Changeset 1434 for code/branches/console/src/core/CommandEvaluation.cc
- Timestamp:
- May 27, 2008, 12:27:13 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/console/src/core/CommandEvaluation.cc
r1430 r1434 30 30 #include "ConsoleCommand.h" 31 31 #include "Debug.h" 32 #include "util/String.h" 32 33 33 34 namespace orxonox … … 81 82 } 82 83 83 if (!this->bCommandChanged_ )84 if (!this->bCommandChanged_ || removeTrailingWhitespaces(this->command_) == removeTrailingWhitespaces(this->originalCommand_)) 84 85 { 85 86 COUT(4) << "CE_execute: " << this->command_ << "\n"; … … 136 137 maxIndex -= 1; 137 138 std::string whitespace = ""; 138 if (this->function_->getParamCount() > (maxIndex + 1 - this->getStartindex()))139 whitespace = " ";140 139 141 140 if (this->possibleArgument_ != "") 142 141 { 143 maxIndex -= 1;144 142 this->argument_ = this->possibleArgument_; 143 if (this->function_->getParamCount() > (maxIndex + 1 - this->getStartindex())) 144 whitespace = " "; 145 145 } 146 146 … … 163 163 { 164 164 case CS_Uninitialized: 165 std::cout << "hint: CS_Uninitialized" << std::endl; 165 166 break; 166 167 case CS_Empty: 168 std::cout << "hint: CS_Empty" << std::endl; 167 169 case CS_ShortcutOrIdentifier: 170 std::cout << "hint: CS_ShortcutOrIdentifier" << std::endl; 168 171 if (this->listOfPossibleFunctions_.size() == 0) 169 172 return CommandEvaluation::dump(this->listOfPossibleIdentifiers_); … … 174 177 break; 175 178 case CS_Function: 179 std::cout << "hint: CS_Function" << std::endl; 176 180 return CommandEvaluation::dump(this->listOfPossibleFunctions_); 177 181 break; 178 182 case CS_ParamPreparation: 183 std::cout << "hint: CS_ParamPreparation" << std::endl; 179 184 case CS_Params: 185 std::cout << "hint: CS_Params" << std::endl; 180 186 if (this->listOfPossibleArguments_.size() > 0) 181 187 return CommandEvaluation::dump(this->listOfPossibleArguments_); … … 183 189 return CommandEvaluation::dump(this->function_); 184 190 case CS_Finished: 191 std::cout << "hint: CS_Finished" << std::endl; 185 192 if (this->function_) 186 193 return CommandEvaluation::dump(this->function_); 187 194 break; 188 195 case CS_Error: 196 std::cout << "hint: CS_Error" << std::endl; 189 197 return this->errorMessage_; 190 198 break; … … 272 280 } 273 281 282 std::string CommandEvaluation::dump(const std::list<std::pair<std::string, std::string> >& list) 283 { 284 std::string output = ""; 285 for (std::list<std::pair<std::string, std::string> >::const_iterator it = list.begin(); it != list.end(); ++it) 286 { 287 if (it != list.begin()) 288 output += " "; 289 290 output += (*it).second; 291 } 292 return output; 293 } 294 274 295 std::string CommandEvaluation::dump(const ConsoleCommand* command) 275 296 {
Note: See TracChangeset
for help on using the changeset viewer.