Class: But::SubCommandBase
- Inherits:
-
Thor
- Object
- Thor
- But::SubCommandBase
- Defined in:
- lib/but/cli.rb
Class Method Summary collapse
Class Method Details
.banner(command, namespace = nil, subcommand = false) ⇒ Object
7 8 9 |
# File 'lib/but/cli.rb', line 7 def self.(command, namespace = nil, subcommand = false) "#{basename} #{subcommand_prefix} #{command.usage}" end |
.subcommand_prefix ⇒ Object
11 12 13 |
# File 'lib/but/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 |