gitlab-org--gitlab-foss/lib/gitlab/slash_commands/help.rb

31 lines
642 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2017-01-11 09:04:49 -05:00
module Gitlab
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)
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