Class: Speedrun::CLI
- Inherits:
-
Thor
- Object
- Thor
- Speedrun::CLI
- Defined in:
- lib/speedrun/cli.rb
Instance Method Summary collapse
Instance Method Details
#trim(input_file, output_file = nil) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/speedrun/cli.rb', line 17 def trim(input_file, output_file = nil) unless File.exist?(input_file) puts "Error: File not found: #{input_file}" exit 1 end trimmer = Trimmer.new( input_file, output_file, noise_threshold: [:noise], min_duration: [:duration], quiet: [:quiet] ) trimmer.dry_run = [:'dry-run'] trimmer.run rescue => e puts "Error: #{e.}" exit 1 end |