bin/flac2mp3 in flac2mp3-0.2.6 vs bin/flac2mp3 in flac2mp3-0.2.7
- old
+ new
@@ -13,11 +13,11 @@
require 'flac2mp3'
require 'flac2mp3/version'
# NOTE: the option -p/--path= is given as an example, and should probably be replaced in your application.
-OPTIONS = { :delete => false }
+OPTIONS = { :delete => false, :silent => false }
MANDATORY_OPTIONS = %w[]
parser = OptionParser.new do |opts|
opts.banner = <<BANNER
Usage: #{File.basename($0)} [filename]
@@ -27,11 +27,12 @@
opts.separator ''
opts.on('-v', '--version',
"Show the #{File.basename($0)} version number and exit") { puts "flac2mp3 #{Flac2mp3::VERSION::STRING}"; exit }
opts.on('-d', '--[no-]delete',
"Delete the original file after conversion") { |delete| OPTIONS[:delete] = delete }
-
+ opts.on('-s', '--silent',
+ "Don't show progress") { |silent| OPTIONS[:silent] = silent }
opts.on('-h', '--help',
'Show this help message.') { puts opts; exit }
opts.parse!(ARGV)
if MANDATORY_OPTIONS && MANDATORY_OPTIONS.find { |option| OPTIONS[option.to_sym].nil? }
@@ -45,6 +46,6 @@
unless filename
puts "Usage: #{File.basename($0)} [filename]"
exit
end
-Flac2mp3.convert(filename.dup, OPTIONS[:delete])
+Flac2mp3.convert(filename.dup, OPTIONS)