lib/everyday-cli-utils/option.rb in everyday-cli-utils-1.5.1 vs lib/everyday-cli-utils/option.rb in everyday-cli-utils-1.5.2
- old
+ new
@@ -81,10 +81,10 @@
def_type(:option_with_param,
->(settings) {
settings[:append] ? [] : nil
},
->(current_value, new_value, settings) {
- settings[:append] ? (current_value + new_value) : (new_value.nil? ? current_value : new_value)
+ settings[:append] ? (current_value + new_value) : ((new_value.nil? || new_value == '') ? current_value : new_value)
},
->(names, settings) {
names[0] << ' PARAM' unless names.any? { |v| v.include?(' ') }
names = settings.has_key?(:desc) ? (names + [settings[:desc]]) : names
settings.has_key?(:type) ? (names + [settings[:type]]) : names
\ No newline at end of file