diff options
author | Eric Wong <e@80x24.org> | 2022-01-07 05:35:42 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2022-01-11 18:21:59 +0000 |
commit | 593b3a2bd374c30ee9e62cfa7144bb371d82f10e (patch) | |
tree | 9b60d7b4667264638dd9d2008a00a2695f661aa7 | |
parent | e6ca961fd5fe69afeec6c024dfbf9f12a3decde1 (diff) | |
download | dtas-593b3a2bd374c30ee9e62cfa7144bb371d82f10e.tar.gz |
We'll take advantage of multicore if available; because even bums like me have SMP machines these days.
-rwxr-xr-x | bin/dtas-splitfx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/dtas-splitfx b/bin/dtas-splitfx index 3ee812e..18ea0b4 100755 --- a/bin/dtas-splitfx +++ b/bin/dtas-splitfx @@ -8,7 +8,7 @@ require 'dtas/splitfx' usage = "#$0 [-n|--dry-run][-j [JOBS]][-s|--silent] SPLITFX_FILE.yml [TARGET]" overrides = {} # FIXME: not tested default_target = "flac" -opts = { jobs: 1 } +opts = { jobs: nil } OptionParser.new('', 24, ' ') do |op| op.banner = usage op.on('-n', '--dry-run') { opts[:dryrun] = true } @@ -37,6 +37,11 @@ if opts[:sox_pipe] && opts[:err_suffix] abort '--err-suffix and --sox-pipe are mutually exclusive' end +if opts[:jobs].nil? + require 'etc' + opts[:jobs] = Etc.nprocessors +end + args = [] ARGV.each do |arg| case arg |