aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cask/lib/hbc/cli/base.rb
blob: e218a47dd2cab38bac0ea8f99ebdf485ae40adfd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
module Hbc
  class CLI
    class Base
      def self.command_name
        @command_name ||= name.sub(/^.*:/, "").gsub(/(.)([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
  end
end