]> Sergey Matveev's repositories - feeder.git/blobdiff - cmd/encs
Trivial style fixes
[feeder.git] / cmd / encs
index a3642668ce45c1d31b6a09aeb1b3b33fe8b0b498..d16ab5efdbc9cfca0ca2ed9125842491ebcea969 100755 (executable)
--- a/cmd/encs
+++ b/cmd/encs
@@ -1,22 +1,21 @@
 #!/usr/bin/env zsh
-set -e
+setopt ERR_EXIT EXTENDED_GLOB
 cmds=$0:h:a
 . $cmds/env.rc
 fpath=($cmds/functions.zsh $fpath)
 dst=$2:a
 cd $1
-[[ -n "$dst" ]] || { dst=encs ; dst=$dst:a }
+[[ -n $dst ]] || { dst=encs ; dst=$dst:a }
 mkdir -p $dst
 autoload url-to-filename
 zmodload -F zsh/datetime b:strftime
-setopt EXTENDED_GLOB
 for new (new/*(N)) {
     while read line ; do
-        [[ "$line" != "" ]] || break
+        [[ -n $line ]] || break
         cols=(${(s: :)line})
         [[ $cols[1] = "X-Enclosure:" ]] || continue
         url=$cols[2]
-        [[ -n "$url" ]]
+        [[ -n $url ]]
         fn=$(strftime %Y%m%d-%H%M%S)-$(url-to-filename $url)
         ${=WGET} --user-agent=$FEEDER_USER_AGENT \
             --output-document=$dst/$fn $url 2>&2 2>encs.log