Class: SubCommandBase

Inherits:
Thor
  • Object
show all
Defined in:
lib/udb/cli.rb

Class Method Summary collapse

Class Method Details



16
17
18
# File 'lib/udb/cli.rb', line 16

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

.subcommand_prefixObject



20
21
22
23
24
# File 'lib/udb/cli.rb', line 20

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