Sha256: fab4779954514ad7bfcadfa8795d6147af5ae0060930029b650a2bb99b6877c0
Contents?: true
Size: 573 Bytes
Versions: 8
Compression:
Stored size: 573 Bytes
Contents
module EverydayCliUtils class Option def self.add_option(options, opts, names, opt_name, settings = {}) opts.on(*names) { options[opt_name] = !settings[:toggle] || !options[opt_name] yield if block_given? } end def self.add_option_with_param(options, opts, names, opt_name, settings = {}) opts.on(*names, settings[:type] || String) { |param| if settings[:append] options[opt_name] << param else options[opt_name] = param end yield if block_given? } end end end
Version data entries
8 entries across 8 versions & 1 rubygems