Sha256: c91ce974d7b524cf507bc2b759de1dbe07c94ad9935c9d7dcc4d77e939d59466
Contents?: true
Size: 784 Bytes
Versions: 17
Compression:
Stored size: 784 Bytes
Contents
module Eco class CLI class Scripting class Argument attr_reader :key class << self def is_modifier?(value) value&.start_with?("-") end end def initialize(key, with_param: false) @key = key @with_param = !!with_param end def args_slice(*args) #pp "known arg '#{key}' => included? #{args.include?(key)}" return args unless args.include?(key) i = args.index(key) j = with_param?? i+1 : i args - args.slice(i..j) end def with_param! @with_param = true end def with_param? @with_param end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems