about summary refs log tree commit homepage
path: root/bin/dtas-splitfx
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-04-09 20:12:22 +0000
committerEric Wong <e@yhbt.net>2020-04-20 10:04:02 +0000
commit974854f21a1787a62b4cf8d7716c65f3712819df (patch)
tree63e81b7cd5fe7500f2f49f49595252939f0d6d6c /bin/dtas-splitfx
parent65339db1168b36cb3ac262eef52f06183dd92ff5 (diff)
downloaddtas-974854f21a1787a62b4cf8d7716c65f3712819df.tar.gz
Write the contents of "stderr".  This is useful for capturing the
per-track output of the sox(1) "stats" effect when combined with
parallel "--jobs".
Diffstat (limited to 'bin/dtas-splitfx')
-rwxr-xr-xbin/dtas-splitfx7
1 files changed, 7 insertions, 0 deletions
diff --git a/bin/dtas-splitfx b/bin/dtas-splitfx
index d041679..3ee812e 100755
--- a/bin/dtas-splitfx
+++ b/bin/dtas-splitfx
@@ -23,6 +23,9 @@ OptionParser.new('', 24, '  ') do |op|
   end
   op.on('-b', '--bits RATE', Integer) { |val| opts[:bits] = val }
   op.on('-t', '--trim POSITION') { |val| opts[:trim] = val.tr(',', ' ') }
+  op.on('-E', '--err-suffix SUFFIX') do |val|
+    opts[:err_suffix] = val.start_with?('.') ? val.freeze : ".#{val}"
+  end
   op.on('-p', '--sox-pipe') do
     opts[:sox_pipe] = true
     default_target = 'sox'
@@ -30,6 +33,10 @@ OptionParser.new('', 24, '  ') do |op|
   op.parse!(ARGV)
 end
 
+if opts[:sox_pipe] && opts[:err_suffix]
+  abort '--err-suffix and --sox-pipe are mutually exclusive'
+end
+
 args = []
 ARGV.each do |arg|
   case arg