]> Sergey Matveev's repositories - feeder.git/blobdiff - cmd/warcs
Trivial style fixes
[feeder.git] / cmd / warcs
index 2f662abe2df420a7534a9bd2ff5137db8f6c3ca5..7934b63c2182230168870bedaf17f01ae4d127cb 100755 (executable)
--- a/cmd/warcs
+++ b/cmd/warcs
@@ -1,15 +1,14 @@
 #!/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=warcs ; dst=$dst:a }
+[[ -n $dst ]] || { dst=warcs ; dst=$dst:a }
 mkdir -p $dst
 autoload url-to-filename
 zmodload -F zsh/datetime b:strftime
-setopt EXTENDED_GLOB
 wget_opts=(
     --user-agent="$FEEDER_USER_AGENT"
     --page-requisites
@@ -20,7 +19,7 @@ wget_opts=(
 )
 for new (new/*(N)) {
     while read line ; do
-        [[ "$line" != "" ]] || break
+        [[ -n $line ]] || break
         cols=(${(s: :)line})
         [[ $cols[1] = "X-URL:" ]] || continue
         url=$cols[2]