Class: SubCommandBase

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

Class Method Summary collapse

Class Method Details



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

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

.subcommand_prefixObject



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

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