Class: Strum::SubCommandBase

Inherits:
Thor
  • Object
show all
Defined in:
lib/strum/sub_command_base.rb

Overview

SubCommand Base class

Class Method Summary collapse

Class Method Details



8
9
10
# File 'lib/strum/sub_command_base.rb', line 8

def self.banner(command, _namespace = nil, _subcommand = false)
  "#{basename} #{subcommand_prefix} #{command.usage}"
end

.subcommand_prefixObject



12
13
14
15
16
# File 'lib/strum/sub_command_base.rb', line 12

def self.subcommand_prefix
  name.gsub(/.*::/, "")
      .gsub(/^[A-Z]/) { |match| match[0].downcase }
      .gsub(/[A-Z]/) { |match| "-#{match[0].downcase}" }
end