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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

33 lines
673 B
Ruby
Raw Normal View History

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