Sha256: 61d1f5f4f7d491fbaaf644205e680d38623e84d96f42a8d8b0fc0bc75051f5fd
Contents?: true
Size: 793 Bytes
Versions: 117
Compression:
Stored size: 793 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
117 entries across 117 versions & 1 rubygems