- Timestamp:
- Apr 28, 2006, 1:30:13 AM (19 years ago)
- Location:
- trunk/src/lib/shell
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/shell/shell_command.cc
r7414 r7415 184 184 { 185 185 retCmd = ShellCommand::getCommand(strings[2], cmdClass); 186 paramBegin = 3;186 paramBegin = 3; 187 187 } 188 188 if (retCmd != NULL) // check for the paramBegin. -
trunk/src/lib/shell/shell_completion.cc
r7414 r7415 56 56 long completeType = NullCompletion; //< the Type we'd like to complete. 57 57 std::string completeString = ""; //< the string to complete. 58 unsigned int parameterBegin = 0; //< The SubString-entry, the Parameters begin.58 unsigned int completeParam = 0; //< The Parameter to finish. 59 59 const ShellCommand* command = NULL; //< The Command. 60 60 … … 102 102 if (completeType == NullCompletion) 103 103 { 104 104 unsigned int parameterBegin = parameterBegin; 105 105 if ((command = ShellCommand::getCommandFromInput(inputSplits, parameterBegin)) != NULL) 106 106 completeType |= ParamCompletion; 107 if (emptyComplete) 108 completeParam = inputSplits.size() - parameterBegin; 109 else 110 completeParam = inputSplits.size() - parameterBegin - 1; 107 111 } 108 112 … … 116 120 this->aliasComplete(completeString); 117 121 if (completeType & ParamCompletion) 118 this->paramComplete(completeString, command );122 this->paramComplete(completeString, command, completeParam); 119 123 120 124 this->generalComplete(input, completeString); … … 177 181 * @returns true on succes, false if something went wrong 178 182 */ 179 bool ShellCompletion::paramComplete(const std::string& paramBegin, const ShellCommand* command) 180 { 183 bool ShellCompletion::paramComplete(const std::string& paramBegin, const ShellCommand* command, unsigned int paramNumber) 184 { 185 if (paramNumber >= command->getParamCount()) 186 { 187 PRINT(0)("Last Parameter reached\n"); 188 return false; 189 } 181 190 std::vector<std::string> completed; 182 command->getCompletorPlugin(0)->addToCompleteList(completed, paramBegin); 183 for (unsigned int i = 0; i < completed.size(); i++) 184 this->completionList.push_back(CompletionElement(completed[i], ParamCompletion)); 191 command->getCompletorPlugin(paramNumber)->addToCompleteList(completed, paramBegin); 192 for (unsigned int i = 0; i < completed.size(); i++) 193 this->completionList.push_back(CompletionElement(completed[i], ParamCompletion)); 194 return true; 185 195 } 186 196 -
trunk/src/lib/shell/shell_completion.h
r7413 r7415 56 56 bool commandComplete(const std::string& commandBegin, const std::string& className); 57 57 bool aliasComplete(const std::string& aliasBegin); 58 bool paramComplete(const std::string& paramBegin, const ShellCommand* command );58 bool paramComplete(const std::string& paramBegin, const ShellCommand* command, unsigned int paramNumber); 59 59 60 60 // Generally Completes.
Note: See TracChangeset
for help on using the changeset viewer.