Class: SKP::SubCommandBase
- Inherits:
-
Thor
- Object
- Thor
- SKP::SubCommandBase
- Defined in:
- lib/skp/cli/sub_command_base.rb
Direct Known Subclasses
Class Method Summary collapse
Class Method Details
.banner(command, namespace = nil, subcommand = false) ⇒ Object
3 4 5 |
# File 'lib/skp/cli/sub_command_base.rb', line 3 def self.(command, namespace = nil, subcommand = false) "#{basename} #{subcommand_prefix} #{command.usage}" end |
.subcommand_prefix ⇒ Object
7 8 9 10 |
# File 'lib/skp/cli/sub_command_base.rb', line 7 def self.subcommand_prefix name.gsub(%r{.*::}, "").gsub(%r{^[A-Z]}) { |match| match[0].downcase } .gsub(%r{[A-Z]}) { |match| "-#{match[0].downcase}" } end |