Class: Aperitiiif::CLI::SubCommandBase

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

Overview

TO DO COMMENT

Direct Known Subclasses

Batch

Class Method Summary collapse

Class Method Details



9
10
11
# File 'lib/aperitiiif/cli.rb', line 9

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

.subcommand_prefixObject



13
14
15
16
17
18
# File 'lib/aperitiiif/cli.rb', line 13

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