Class: SubCommandBase

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

Class Method Summary collapse

Class Method Details



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

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

.subcommand_prefixObject



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

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