class IDL::OptionList::Option::Group
def description
def description @sets.values.inject(@description.dup) { |desc, a| desc.concat(a.description) } end
def handle_sets(param, options, *ext_args)
def handle_sets(param, options, *ext_args) @sets.values.inject(false) { |f, s| s.run(param, options, *ext_args) || f } end
def initialize(id, options)
def initialize(id, options) @test = options[:test] || true @description = Array === options[:description] ? options[:description] : (options[:description] || '').split('\n') @sets = {} if options[:params] && Hash === options[:params] @sets[id] = ParamSet.new(params: options[:params]) end end
def run(arg, options)
def run(arg, options) ext_args = [] if self.respond_to?(:_prepare, true) result = _prepare(arg, options) return false unless result && !result.empty? arg = result.shift ext_args = result else case @test when TrueClass when Regexp return false unless @test =~ arg else return false unless @test == arg end end return handle_sets(arg, options, *ext_args) end