@@ -23,14 +23,21 @@ for p in pandoc tidy; do
26−ARGS=${ALL%%-- *}
26+ARGS=${ALL%% -- *} # only the part before ' -- ' delimiters is relevant
27−REST=${ALL#$ARGS}
27+set -- $ARGS
29−REST=${REST#--}
29+REST=${ALL#$ARGS}; REST=${REST#--}
30PANDOC_OPTS=${REST:-$PANDOC_OPTS}
30PANDOC_OPTS=${REST:-$PANDOC_OPTS}
36+ echo >&2 "Warning: extra arguments '$@' will be ignored!"
32−if [ -z "$1" ] || [ -f $1 ]; then
39+if [ -z "$infile" ] || [ -f $infile ]; then
33− tidy -utf8 $1 2>/dev/null | \
40+ tidy -utf8 $infile 2>/dev/null | \
34 pandoc $PANDOC_OPTS -r html -w markdown -s | \
41 pandoc $PANDOC_OPTS -r html -w markdown -s | \
35 iconv -f utf-8
42 iconv -f utf-8
@@ -55,7 +62,7 @@ else
57 # Fetch and feed to pandoc.
64 # Fetch and feed to pandoc.
58− $DUMPER $OPT $1 2>/dev/null | \
65+ $DUMPER $OPT $infile 2>/dev/null | \
59 tidy -utf8 2>/dev/null | \
66 tidy -utf8 2>/dev/null | \
60 pandoc $PANDOC_OPTS -r html -w markdown -s | \
67 pandoc $PANDOC_OPTS -r html -w markdown -s | \
61 iconv -f utf-8
68 iconv -f utf-8