Class: SubCommandBase
- Inherits:
-
Thor
- Object
- Thor
- SubCommandBase
show all
- Defined in:
- lib/udb/cli.rb
Class Method Summary
collapse
Class Method Details
.banner(command, _namespace = nil, _subcommand = false) ⇒ Object
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_prefix ⇒ Object
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
|