summaryrefslogtreecommitdiff
path: root/src/command_manager.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2015-09-06 18:09:32 +0100
committerMaxime Coste <frrrwww@gmail.com>2015-09-06 18:09:32 +0100
commit30ad9a04759bc85931446cd8f4594ea71db22985 (patch)
treee097d6f4981df031212982c1d68f058621672470 /src/command_manager.cc
parenta45876124b0f0abad828f81c9406b37e0c2dc622 (diff)
Complete aliases in command prompt
Diffstat (limited to 'src/command_manager.cc')
-rw-r--r--src/command_manager.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/command_manager.cc b/src/command_manager.cc
index e626ed6c..5d5920a2 100644
--- a/src/command_manager.cc
+++ b/src/command_manager.cc
@@ -567,9 +567,14 @@ Completions CommandManager::complete(const Context& context,
{
if (command.second.flags & CommandFlags::Hidden)
continue;
- if ( prefix_match(command.first, prefix))
+ if (prefix_match(command.first, prefix))
result.candidates.push_back(command.first);
}
+ for (auto& alias : context.aliases())
+ {
+ if (prefix_match(alias.first, prefix))
+ result.candidates.push_back(alias.first);
+ }
std::sort(result.candidates.begin(), result.candidates.end());
return result;
}