Class: Calicli::CLI::Base
- Inherits:
-
Thor
- Object
- Thor
- Calicli::CLI::Base
- Defined in:
- lib/calicli/cli/base.rb
Class Method Summary collapse
Class Method Details
.banner(command, namespace = nil, subcommand = false) ⇒ Object
4 5 6 |
# File 'lib/calicli/cli/base.rb', line 4 def self.(command, namespace = nil, subcommand = false) "#{basename} #{subcommand_prefix} #{command.usage}" end |
.subcommand_prefix ⇒ Object
8 9 10 |
# File 'lib/calicli/cli/base.rb', line 8 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 |