module Eco class CLI class Scripting class Argument attr_reader :key 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