[PATCH v2 2/7] parsemail-batch.sh: pass command-line options to parsemail

Daniel Axtens dja at axtens.net
Wed Sep 28 15:22:55 AEST 2016


Signed-off-by: Daniel Axtens <dja at axtens.net>
Reviewed-by: Stephen Finucane <stephenfinucane at hotmail.com>
---
 patchwork/bin/parsemail-batch.sh | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/patchwork/bin/parsemail-batch.sh b/patchwork/bin/parsemail-batch.sh
index 31ef4f0a7e4f..06de3d77ac95 100755
--- a/patchwork/bin/parsemail-batch.sh
+++ b/patchwork/bin/parsemail-batch.sh
@@ -21,9 +21,9 @@
 
 PATCHWORK_BINDIR=`dirname $0`
 
-if [ $# -ne 1 ]
+if [ $# -lt 1 ]
 then
-	echo "usage: $0 <dir>" >&2
+	echo "usage: $0 <dir> [options]" >&2
 	exit 1
 fi
 
@@ -37,9 +37,11 @@ then
 	exit 1
 fi
 
+shift
+
 ls -1rt "$mail_dir" |
 while read line;
 do
 	echo $line
-	$PATCHWORK_BINDIR/parsemail.sh < "$mail_dir/$line"
+	$PATCHWORK_BINDIR/parsemail.sh $@ < "$mail_dir/$line"
 done
-- 
2.7.4



More information about the Patchwork mailing list