Sha256: 9510e4711abf230af6d998e74d7dad104db7481cf445ad86688f9f64f799e8d5
Contents?: true
Size: 583 Bytes
Versions: 81
Compression:
Stored size: 583 Bytes
Contents
# frozen_string_literal: true # Thor with subcommands that work correctly with help class SubCommandBase < Thor # Set the subcommand banner. # rubocop:disable Style/OptionalBooleanParameter def self.banner(command, _namespace = nil, _subcommand = false) "#{basename} #{subcommand_prefix} #{command.usage}" end # rubocop:enable Style/OptionalBooleanParameter # Set the subcommand prefix. def self.subcommand_prefix name.gsub(/.*::/, '') .gsub(/^[A-Z]/) { |match| match[0].downcase } .gsub(/[A-Z]/) { |match| " #{match[0].downcase}" } end end
Version data entries
81 entries across 81 versions & 2 rubygems