aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cask/lib/hbc/cli/base.rb
blob: af03969af75d4b0b7d46327c33df2d75cb41075c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
class Hbc::CLI::Base
  def self.command_name
    @command_name ||= name.sub(%r{^.*:}, "").gsub(%r{(.)([A-Z])}, '\1_\2').downcase
  end

  def self.visible
    true
  end

  def self.cask_tokens_from(args)
    args.reject { |a| a.empty? || a.chars.first == "-" }
  end

  def self.help
    "No help available for the #{command_name} command"
  end

  def self.needs_init?
    false
  end
end