Class: Aircana::CLI::Subcommand
- Inherits:
-
Thor
- Object
- Thor
- Aircana::CLI::Subcommand
- Defined in:
- lib/aircana/cli/subcommand.rb
Direct Known Subclasses
Class Method Summary collapse
-
.banner(command, _namespace = nil, _subcommand = false) ⇒ Object
rubocop:disable Style/OptionalBooleanParameter.
- .subcommand_prefix ⇒ Object
Class Method Details
.banner(command, _namespace = nil, _subcommand = false) ⇒ Object
rubocop:disable Style/OptionalBooleanParameter
8 9 10 |
# File 'lib/aircana/cli/subcommand.rb', line 8 def self.(command, _namespace = nil, _subcommand = false) # rubocop:disable Style/OptionalBooleanParameter "#{basename} #{subcommand_prefix} #{command.usage}" end |
.subcommand_prefix ⇒ Object
12 13 14 15 16 17 |
# File 'lib/aircana/cli/subcommand.rb', line 12 def self.subcommand_prefix # Extract the main command name from class name (e.g., "FilesSubcommand" -> "files") name.gsub(/.*::/, "").gsub(/Subcommand$/, "").gsub(/^[A-Z]/) do |match| match[0].downcase end.gsub(/[A-Z]/) { |match| "-#{match[0].downcase}" } # rubocop:disable Style/MultilineBlockChain end |