lib/samovar/options.rb in samovar-2.2.0 vs lib/samovar/options.rb in samovar-2.3.0
- old
+ new
@@ -1,9 +1,9 @@
# frozen_string_literal: true
# Released under the MIT License.
-# Copyright, 2016-2023, by Samuel Williams.
+# Copyright, 2016-2024, by Samuel Williams.
require_relative 'option'
module Samovar
class Options
@@ -88,10 +88,12 @@
def parse(input, parent = nil, default = nil)
values = (default || @defaults).dup
while option = @keyed[input.first]
- if result = option.parse(input)
+ prefix = input.first
+ result = option.parse(input)
+ if result != nil
values[option.key] = result
end
end
return values