Sha256: a6389b496224df4a2638105d20f6a3080b69e4d6a7d9dc1c1f1a94b7da0098a3
Contents?: true
Size: 604 Bytes
Versions: 27
Compression:
Stored size: 604 Bytes
Contents
# frozen_string_literal: true require 'eac_cli/definition/base_option' module EacCli class Definition class BooleanOption < ::EacCli::Definition::BaseOption def argument? false end def build_value(_new_value, previous_value) repeat? ? previous_value + 1 : true end def default_value return super unless default_value? raise(::EacCli::Definition::Error, "Unallowed default value for boolean options (Option: #{self})") end def default_default_value repeat? ? 0 : false end end end end
Version data entries
27 entries across 27 versions & 2 rubygems