lib/pdk/cli/util/option_normalizer.rb in pdk-0.3.0 vs lib/pdk/cli/util/option_normalizer.rb in pdk-0.4.0
- old
+ new
@@ -26,11 +26,11 @@
formats.map do |f|
format, target = f.split(':', 2)
begin
OptionValidator.enum(format, PDK::Report.formats)
- rescue
+ rescue ArgumentError
raise PDK::CLI::FatalError, _("'%{name}' is not a valid report format (%{valid})") % {
name: format,
valid: PDK::Report.formats.join(', '),
}
end
@@ -38,9 +38,11 @@
case target
when 'stdout'
target = $stdout
when 'stderr'
target = $stderr
+ when nil
+ target = PDK::Report.default_target
end
{ method: "write_#{format}".to_sym, target: target }
end
end