- 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/Shell.cc
r7219 r7228 315 315 this->updateListeners<&ShellListener::executed>(); 316 316 317 bool success; 318 const std::string& result = CommandExecutor::query(this->inputBuffer_->get(), &success); 319 if (!success) 320 { 321 this->outputBuffer_ << "Error: Can't execute \"" << this->inputBuffer_->get() << "\"." << std::endl; 317 int error; 318 const std::string& result = CommandExecutor::query(this->inputBuffer_->get(), &error); 319 if (error) 320 { 321 switch (error) 322 { 323 case CommandExecutor::Error: this->outputBuffer_ << "Error: Can't execute \"" << this->inputBuffer_->get() << "\", command doesn't exist. (S)" << std::endl; break; 324 case CommandExecutor::Incomplete: this->outputBuffer_ << "Error: Can't execute \"" << this->inputBuffer_->get() << "\", not enough arguments given. (S)" << std::endl; break; 325 case CommandExecutor::Deactivated: this->outputBuffer_ << "Error: Can't execute \"" << this->inputBuffer_->get() << "\", command is not active. (S)" << std::endl; break; 326 case CommandExecutor::Denied: this->outputBuffer_ << "Error: Can't execute \"" << this->inputBuffer_->get() << "\", access denied. (S)" << std::endl; break; 327 } 322 328 this->outputChanged(Error); 323 329 } … … 333 339 void Shell::hintAndComplete() 334 340 { 335 this->inputBuffer_->set(CommandExecutor:: complete(this->inputBuffer_->get()));336 this->outputBuffer_ << CommandExecutor:: hint(this->inputBuffer_->get()) << std::endl;341 this->inputBuffer_->set(CommandExecutor::evaluate(this->inputBuffer_->get()).complete()); 342 this->outputBuffer_ << CommandExecutor::evaluate(this->inputBuffer_->get()).hint() << std::endl; 337 343 this->outputChanged(Hint); 338 344
Note: See TracChangeset
for help on using the changeset viewer.