Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5195 in orxonox.OLD for trunk/src/lib/shell/shell_completion.cc


Ignore:
Timestamp:
Sep 18, 2005, 2:13:28 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: alias-completion works too now :)

File:
1 edited

Legend:

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

    r5194 r5195  
    108108  if (inputSplits.getCount() == 0)
    109109  {
    110     PRINTF(5)("Listing all Classes\n");
    111110    completeType |= SHELLC_CLASS;
     111    completeType |= SHELLC_ALIAS;
     112
    112113  }
    113114  else if (inputSplits.getCount() == 1 && emptyComplete == false)
    114115  {
    115     printf("trying to complete a Class with '%s'\n", inputSplits.getString(0));
    116116    completeType |= SHELLC_CLASS;
     117    completeType |= SHELLC_ALIAS;
    117118  }
    118119
     
    148149  if (completeType & SHELLC_FUNCTION)
    149150    this->functionComplete(completeString, classID);
     151  if (completeType & SHELLC_ALIAS)
     152    this->aliasComplete(completeString);
    150153
    151154
     
    211214  return true;
    212215}
     216
     217bool ShellCompletion::aliasComplete(const char* aliasBegin)
     218{
     219  if (unlikely(aliasBegin == NULL))
     220    return false;
     221  tList<const char> aliasList;
     222  ShellCommandClass::getCommandListOfAlias(&aliasList);
     223  //printf("%s\n", boList->firstElement()->getName());
     224  if (!this->addToCompleteList(&aliasList, aliasBegin))
     225    return false;
     226  return true;
     227}
     228
    213229
    214230/**
Note: See TracChangeset for help on using the changeset viewer.