Class: Libis::Format::Cli::SubCommand
- Inherits:
-
Thor
- Object
- Thor
- Libis::Format::Cli::SubCommand
- Includes:
- PromptHelper
- Defined in:
- lib/libis/format/cli/sub_command.rb
Instance Attribute Summary
Attributes included from PromptHelper
Class Method Summary collapse
Methods included from PromptHelper
Class Method Details
.banner(command, namespace = nil, subcommand = false) ⇒ Object
11 12 13 |
# File 'lib/libis/format/cli/sub_command.rb', line 11 def self.(command, namespace = nil, subcommand = false) "#{basename} #{subcommand_prefix} #{command.usage}" end |
.subcommand_prefix ⇒ Object
15 16 17 |
# File 'lib/libis/format/cli/sub_command.rb', line 15 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 |