diff options
Diffstat (limited to 'lib/gitlab/slash_commands/help.rb')
-rw-r--r-- | lib/gitlab/slash_commands/help.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/gitlab/slash_commands/help.rb b/lib/gitlab/slash_commands/help.rb new file mode 100644 index 00000000000..81f3707e03e --- /dev/null +++ b/lib/gitlab/slash_commands/help.rb @@ -0,0 +1,28 @@ +module Gitlab + module SlashCommands + 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 + + def execute(commands, text) + Gitlab::SlashCommands::Presenters::Help.new(commands).present(trigger, text) + end + + def trigger + params[:command] + end + end + end +end |