[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/2] splitfx: disallow combining --trim and --filter
From: |
Eric Wong |
Subject: |
[PATCH 1/2] splitfx: disallow combining --trim and --filter |
Date: |
Thu, 3 Feb 2022 00:48:20 +0000 |
They're two different ways of accomplishing roughly the same thing,
but --filter can be more flexible given the use of per-track
environment variables.
---
lib/dtas/splitfx.rb | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/dtas/splitfx.rb b/lib/dtas/splitfx.rb
index 696b9ce..c7eaf42 100644
--- a/lib/dtas/splitfx.rb
+++ b/lib/dtas/splitfx.rb
@@ -1,4 +1,4 @@
-# Copyright (C) 2013-2020 all contributors <dtas-all@nongnu.org>
+# Copyright (C) all contributors <dtas-all@nongnu.org>
# License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
# frozen_string_literal: true
require_relative '../dtas'
@@ -357,7 +357,9 @@ def run(target, opts = {})
@rate = opts[:rate]
@bits = opts[:bits]
trim = opts[:trim] and @tracks = [ UTrim.new(trim, @env, @comments) ]
-
+ if trim && opts[:filter]
+ raise ArgumentError, 'trim and filter are mutually exclusive'
+ end
fails = []
tracks = @tracks.dup
(opts[:filter] || []).each do |re|