2018-11-20 02:01:13 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-01-11 14:04:49 +00:00
|
|
|
module Gitlab
|
2017-05-31 05:50:53 +00:00
|
|
|
module SlashCommands
|
2017-01-11 14:04:49 +00:00
|
|
|
class Help < BaseCommand
|
|
|
|
# This class has to be used last, as it always matches. It has to match
|
|
|
|
# because other commands were not triggered and we want to show the help
|
|
|
|
# command
|
|
|
|
def self.match(_text)
|
|
|
|
true
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.help_message
|
|
|
|
'help'
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.allowed?(_project, _user)
|
|
|
|
true
|
|
|
|
end
|
|
|
|
|
2017-01-30 11:12:57 +00:00
|
|
|
def execute(commands, text)
|
2019-08-26 12:23:36 +00:00
|
|
|
Gitlab::SlashCommands::Presenters::Help
|
|
|
|
.new(project, commands)
|
|
|
|
.present(trigger, text)
|
2017-01-11 14:04:49 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def trigger
|
|
|
|
params[:command]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|