CmdCompletionContext: Implement the context completion list

This commit is contained in:
Tomas Babej 2015-02-21 13:48:26 +01:00 committed by Paul Beckingham
parent edb54a51b3
commit 5f3dd43893
2 changed files with 6 additions and 2 deletions

View file

@ -220,7 +220,11 @@ CmdCompletionContext::CmdCompletionContext ()
////////////////////////////////////////////////////////////////////////////////
int CmdCompletionContext::execute (std::string& output)
{
std::vector <std::string> contexts;
std::vector <std::string> userContexts = CmdContext::getContexts ();
std::vector <std::string>::iterator userContext;
for (userContext = userContexts.begin (); userContext != userContexts.end (); ++userContext)
output += *userContext + "\n";
return 0;
}

View file

@ -36,7 +36,7 @@ public:
CmdContext ();
int execute (std::string&);
std::string joinWords (std::vector <std::string>& words, unsigned int from, unsigned int to = 0);
std::vector <std::string> getContexts ();
static std::vector <std::string> getContexts ();
int defineContext (std::vector <std::string>& words, std::stringstream& out);
int deleteContext (std::vector <std::string>& words, std::stringstream& out);
int listContexts (std::vector <std::string>& words, std::stringstream& out);