lib/ggem/cli/clirb.rb in ggem-1.10.5 vs lib/ggem/cli/clirb.rb in ggem-1.10.6

- old
+ new

@@ -1,10 +1,10 @@ # frozen_string_literal: true module GGem; end class GGem::CLI; end -class GGem::CLI::CLIRB # Version 1.1.0, https://github.com/redding/cli.rb +class GGem::CLI::CLIRB # Version 1.2.0, https://github.com/redding/cli.rb Error = Class.new(RuntimeError); HelpExit = Class.new(RuntimeError); VersionExit = Class.new(RuntimeError) attr_reader :argv, :args, :opts, :data def initialize(&block) @@ -17,10 +17,10 @@ p.on_tail("--version", ""){ |v| raise VersionExit, v.to_s } p.on_tail("--help", ""){ |v| raise HelpExit, v.to_s } end end - def option(*args); @options << Option.new(*args); end + def option(*args, **kargs); @options << Option.new(*args, **kargs); end def parse!(argv) @args = (argv || []).dup.tap do |args_list| begin; @parser.parse!(args_list) rescue OptionParser::ParseError => err; raise Error, err.message; end end; @data = @args + [@opts]