Class: Voom::Presenters::SubCommandBase

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

Direct Known Subclasses

Generate

Class Method Summary collapse

Class Method Details



7
8
9
# File 'lib/voom/presenters/cli.rb', line 7

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

.subcommand_prefixObject



11
12
13
# File 'lib/voom/presenters/cli.rb', line 11

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