Class: Icarus::Mod::CLI::SubcommandBase
- Defined in:
- lib/icarus/mod/cli/subcommand_base.rb
Overview
Base class for all subcommands
Class Method Summary collapse
-
.banner(command, _namespace = nil, _subcommand = false) ⇒ Object
rubocop:disable Style/OptionalBooleanParameter.
-
.subcommand_prefix ⇒ Object
rubocop:enable Style/OptionalBooleanParameter.
Methods inherited from Base
Class Method Details
.banner(command, _namespace = nil, _subcommand = false) ⇒ Object
rubocop:disable Style/OptionalBooleanParameter
31 32 33 |
# File 'lib/icarus/mod/cli/subcommand_base.rb', line 31 def self.(command, _namespace = nil, _subcommand = false) "#{basename} #{subcommand_prefix} #{command.usage}" end |
.subcommand_prefix ⇒ Object
rubocop:enable Style/OptionalBooleanParameter
36 37 38 |
# File 'lib/icarus/mod/cli/subcommand_base.rb', line 36 def self.subcommand_prefix name.gsub(/.*::/, "").gsub(/^[A-Z]/) { |match| match[0].downcase }.gsub(/[A-Z]/) { |match| "-#{match[0].downcase}" } end |