2017-01-11 09:04:49 -05:00
|
|
|
module Gitlab
|
2017-05-31 01:50:53 -04:00
|
|
|
module SlashCommands
|
2017-01-11 09:04:49 -05: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 06:12:57 -05:00
|
|
|
def execute(commands, text)
|
2017-05-31 01:50:53 -04:00
|
|
|
Gitlab::SlashCommands::Presenters::Help.new(commands).present(trigger, text)
|
2017-01-11 09:04:49 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def trigger
|
|
|
|
params[:command]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|