From bccf40dd51e06ece51a023cf75b0cc8bce904d30 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 7 Sep 2013 22:39:27 +0000 Subject: splitfx: flesh out functionality + integration test This seems to be working out nicely. Having a basic integration test should be enough to get us started for now. --- bin/dtas-splitfx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'bin') diff --git a/bin/dtas-splitfx b/bin/dtas-splitfx index 2d66c0d..d75c1de 100755 --- a/bin/dtas-splitfx +++ b/bin/dtas-splitfx @@ -4,15 +4,16 @@ require 'yaml' require 'optparse' require 'dtas/splitfx' -usage = "#$0 [-n|--dry-run][-j [JOBS]] SPLITFX_FILE.yml [TARGET]" +usage = "#$0 [-n|--dry-run][-j [JOBS]][-s|--silent] SPLITFX_FILE.yml [TARGET]" overrides = {} # FIXME: not tested -dryrun = false +opts = { jobs: 1 } jobs = 1 -op = OptionParser.new('', 24, ' ') do |opts| - opts.banner = usage - opts.on('-n', '--dry-run') { dryrun = true } - opts.on('-j', '--jobs [JOBS]', Integer) { |val| jobs = val } - opts.parse!(ARGV) +OptionParser.new('', 24, ' ') do |op| + op.banner = usage + op.on('-n', '--dry-run') { opts[:dryrun] = true } + op.on('-j', '--jobs [JOBS]', Integer) { |val| opts[:jobs] = val } + op.on('-s', '--quiet', '--silent') { |val| opts[:silent] = true } + op.parse!(ARGV) end args = [] @@ -36,4 +37,4 @@ file = args.shift or abort usage target = args.shift || "flac" splitfx = DTAS::SplitFX.new splitfx.import(YAML.load(File.read(file)), overrides) -splitfx.run(target, jobs, dryrun) +splitfx.run(target, opts) -- cgit v1.2.3-24-ge0c7