Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/slash_commands/presenters/help.rb')
-rw-r--r--lib/gitlab/slash_commands/presenters/help.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/gitlab/slash_commands/presenters/help.rb b/lib/gitlab/slash_commands/presenters/help.rb
index 71bc0dc0123..61b36308d20 100644
--- a/lib/gitlab/slash_commands/presenters/help.rb
+++ b/lib/gitlab/slash_commands/presenters/help.rb
@@ -4,9 +4,10 @@ module Gitlab
module SlashCommands
module Presenters
class Help < Presenters::Base
- def initialize(project, commands)
+ def initialize(project, commands, params = {})
@project = project
@commands = commands
+ @params = params
end
def present(trigger, text)
@@ -66,7 +67,13 @@ module Gitlab
def full_commands_message(trigger)
list = @commands
- .map { |command| "#{trigger} #{command.help_message}" }
+ .map do |command|
+ if command < Gitlab::SlashCommands::IncidentManagement::IncidentCommand
+ "#{@params[:command]} #{command.help_message}"
+ else
+ "#{trigger} #{command.help_message}"
+ end
+ end
.join("\n")
<<~MESSAGE