lib/sfn/config.rb in sfn-2.1.10 vs lib/sfn/config.rb in sfn-2.1.12
- old
+ new
@@ -140,11 +140,13 @@
next unless info[:description]
short = info[:short_flag]
if(!short.to_s.empty? && shorts.include?(short))
raise ArgumentError.new "Short flag already in use! (`#{short}` not available for `#{klass}`)"
end
- shorts << short
- info[:short] = short
+ unless(short.to_s.empty?)
+ shorts << short
+ info[:short] = short
+ end
info[:long] = name.tr('_', '-')
info[:boolean] = [info[:type]].compact.flatten.all?{|t| BOOLEAN_VALUES.include?(t)}
[name, info]
end.compact
]