Changeset 5191 in orxonox.OLD for trunk/src/lib/shell
- Timestamp:
- Sep 18, 2005, 12:26:35 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/shell/shell_completion.cc
r5190 r5191 71 71 72 72 73 PRINTF( 4)("AutoComplete on input\n");73 PRINTF(5)("AutoComplete on input\n"); 74 74 this->emptyCompletionList(); 75 75 … … 83 83 84 84 // Check if we are in a input. eg. the supplied string "class " and now we complete either function or object 85 if (this->input->getInput() == NULL || strlen(this->input->getInput()) == 0 || 86 (this->input->getInput() != NULL && 87 strrchr(this->input->getInput(), ' ') >= this->input->getInput() + strlen(this->input->getInput())-1)) 85 if (this->input->getInput() != NULL && 86 strrchr(this->input->getInput(), ' ') >= this->input->getInput() + strlen(this->input->getInput())-1) 88 87 { 89 88 emptyComplete = true; … … 91 90 92 91 if (this->input->getInput() == NULL) 93 { 94 return this->objectComplete("", CL_SHELL_COMMAND_CLASS); 95 } 96 97 completionLine = this->input->getInput() + strspn(this->input->getInput(), " \t\n"); 92 completionLine = ""; 93 else 94 completionLine = this->input->getInput() + strspn(this->input->getInput(), " \t\n"); 98 95 99 96 SubString inputSplits(completionLine, true); 100 101 97 102 98 // CLASS COMPLETION … … 107 103 return false; 108 104 } 109 else if (inputSplits.getCount() == 1 && strlen(inputSplits.getString(0)) == strlen(completionLine))105 else if (inputSplits.getCount() == 1 && emptyComplete == false) 110 106 { 111 107 printf("trying to complete a Class with '%s'\n", inputSplits.getString(0)); … … 113 109 } 114 110 115 // OBJECT COMPLETIONS 116 else if ( inputSplits.getCount() <= 2 && strlen(inputSplits.getString(0)) < strlen(completionLine)) 111 // OBJECT/FUNCTION COMPLETIONS 112 else if ( (inputSplits.getCount() == 1 && emptyComplete == true ) || 113 (inputSplits.getCount() == 2 && emptyComplete == false)) 117 114 { 118 115 classID = ClassList::StringToID(inputSplits.getString(0));
Note: See TracChangeset
for help on using the changeset viewer.