lib/bhook/args_parser.rb in bhook-0.1.2 vs lib/bhook/args_parser.rb in bhook-0.1.3

- old
+ new

@@ -1,11 +1,16 @@ +# typed: false +# frozen_string_literal: true + module Bhook class ArgsParser - Options = Struct.new(:source, :output, :watch, :verbose, :theme, :generate_theme) + extend T::Sig + + Options = Struct.new(:source, :output, :watch, :verbose, :theme, :generate_theme, :benchmark) def initialize(argv) - @args = Options.new(nil, nil, false, false, nil, nil) + @args = Options.new(nil, nil, false, false, nil, nil, false) @argv = argv.clone @opt_parser = build_opt_parser end def parse @@ -70,9 +75,15 @@ opts.on("--generate-theme=PATH", String, "Generate a baseline theme that you can then modify to your needs") do |path| @args.generate_theme = path + end + + opts.on("--benchmark", + FalseClass, + "Run a performance benchmark for the specified source") do + @args.benchmark = true end opts.on("-h", "--help", "Prints this help") do puts opts exit