Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5188 in orxonox.OLD for trunk/src/lib/shell


Ignore:
Timestamp:
Sep 17, 2005, 1:45:40 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: only retrieve Classes, that actually have a Command associated with them

Location:
trunk/src/lib/shell
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/shell/shell_command.cc

    r5174 r5188  
    3535ShellCommandClass::ShellCommandClass(const char* className)
    3636{
     37  this->setClassID(CL_SHELL_COMMAND_CLASS, "ShellCommandClass");
     38  this->setName(className);
     39
    3740  this->className = className;
    3841  this->classID = CL_NULL;
  • trunk/src/lib/shell/shell_completion.cc

    r5187 r5188  
    4949  if (this->completionList)
    5050  {
     51    this->emptyCompletionList();
    5152    delete this->completionList;
    5253  }
     
    8586  }
    8687  if (this->input->getInput() == NULL)
    87     return this->classComplete("");
     88    return this->objectComplete("", CL_SHELL_COMMAND_CLASS);
    8889
    8990
     
    9798  {
    9899    PRINTF(5)("Listing all Classes\n");
    99     this->classComplete("");
     100    this->objectComplete("", CL_SHELL_COMMAND_CLASS);
    100101    return false;
    101102  }
    102103  else if (inputSplits.getCount() == 1 && strlen(inputSplits.getString(0)) == strlen(completionLine))
    103104  {
    104     printf("trying to complete a Class with %d\n", inputSplits.getString(0));
    105     this->classComplete(inputSplits.getString(0));
     105    printf("trying to complete a Class with '%s'\n", inputSplits.getString(0));
     106    this->objectComplete(inputSplits.getString(0), CL_SHELL_COMMAND_CLASS);
    106107  }
    107108
     
    182183bool ShellCompletion::objectComplete(const char* objectBegin, long classID)
    183184{
    184   printf("%s\n", objectBegin);
    185 
    186185  if (unlikely(objectBegin == NULL))
    187186    return false;
     
    189188  if (boList != NULL)
    190189  {
    191     printf("\n", boList->firstElement()->getName());
     190    //printf("%s\n", boList->firstElement()->getName());
    192191    const tList<ShellC_Element>* objectList = this->addToCompleteList(boList, objectBegin);
    193192    if (objectList != NULL)
     
    325324      newElem->name = enumBO->getName();
    326325      this->completionList->add(newElem);
     326      printf("%s\n",enumBO->getName());
    327327    }
    328328    enumBO = iterator->nextElement();
Note: See TracChangeset for help on using the changeset viewer.