summaryrefslogtreecommitdiff
path: root/lib/gitlab/chat_commands/command.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/chat_commands/command.rb')
-rw-r--r--lib/gitlab/chat_commands/command.rb13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/gitlab/chat_commands/command.rb b/lib/gitlab/chat_commands/command.rb
index ac7ee868402..4e5031a8a26 100644
--- a/lib/gitlab/chat_commands/command.rb
+++ b/lib/gitlab/chat_commands/command.rb
@@ -18,25 +18,22 @@ module Gitlab
Gitlab::ChatCommands::Presenters::Access.new.access_denied
end
else
- help(help_messages)
+ Gitlab::ChatCommands::Help.new(project, current_user, params).execute(available_commands)
end
end
def match_command
match = nil
- service = available_commands.find do |klass|
- match = klass.match(params[:text])
- end
+ service =
+ available_commands.find do |klass|
+ match = klass.match(params[:text])
+ end
[service, match]
end
private
- def help_messages
- available_commands.map(&:help_message)
- end
-
def available_commands
COMMANDS.select do |klass|
klass.available?(project)