Sha256: 4b29ce175a6626c49649bd9befa21da12586a455da5bd477a80fdac2d6df09e5

Contents?: true

Size: 646 Bytes

Versions: 1

Compression:

Stored size: 646 Bytes

Contents

require "thor"

module Ben
  class CLI < Thor

    class_option "no-color", :banner => "Disable colorization in output", :type => :boolean
    class_option "verbose",  :aliases => "-V", :banner => "Enable verbose output mode", :type => :boolean

    attr_reader :o

    def initialize(*)
      super
      o = @o = options.dup
      the_shell = (options["no-color"] ? Thor::Shell::Basic.new : shell)
      Ben.ui = UI::Shell.new(the_shell)
      Ben.ui.debug! if options["verbose"]
    end

    desc "disk [disk_path]", "run benchmark for disk"
    def disk(p_disk=nil)
      p_disk ||= Rc.disk.disk

      Disk.run(p_disk.dup)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ben-0.0.1 lib/ben/cli.rb