summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2014-09-29 10:01:45 +0200
committerJonas Smedegaard <dr@jones.dk>2014-09-29 10:01:45 +0200
commit5741b6aea1f58642df32caf16f96f82dc06255ad (patch)
tree16d8b43a8b7213deed83e969aac655e380d5249b
parentde15250a66ada382000ebca2e2c8c50b46677d4b (diff)
Tidy input sanitation.
-rwxr-xr-xlocalvideowebencode10
1 files changed, 2 insertions, 8 deletions
diff --git a/localvideowebencode b/localvideowebencode
index 0153c2a..31844b7 100755
--- a/localvideowebencode
+++ b/localvideowebencode
@@ -150,16 +150,10 @@ done
# TODO: drop when melt 0.9.2 is stable
melt_recent=$(melt -query filter=loudness | grep -qi R128 && echo yes)
+# sanitize infiles
infiles=$*
-
-if [ -z "$infiles" ]; then
- showhelp
- exit1 "Too few parameters!"
-fi
-
-# input filename (mandatory)
infile_first=$(perl -e 'print pop @ARGV' $infiles)
-[ -e "$infile_first" ] || exit1 "Input file missing!"
+[ -e "$infile_first" ] || exit1 "Cannot read first input file \"$infile_first\"!"
# resolve stem and title (if not explicitly set)
stem=${stem:-$(basename "$infile_first" | perl -pe 's/\.[^.]*//')}