From 83be43d22245a239e2aafe3657f91f0c0e860d04 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Tue, 26 Jul 2016 02:32:53 -0300 Subject: [PATCH] sch2fig/sch2pdf: use correct output file name; pass on -t template.fig --- sch2fig/sch2pdf | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sch2fig/sch2pdf b/sch2fig/sch2pdf index 1d52e35..5a7504d 100755 --- a/sch2fig/sch2pdf +++ b/sch2fig/sch2pdf @@ -2,19 +2,24 @@ usage() { - echo "usage: $0 [-o output.pdf] [-q] file.lib ... file.sch" 1>&2 + cat <&2 +usage: $0 [-o output.pdf] [-q] [-t template.fig ] file.lib ... file.sch +EOF exit 1 } out=out.pdf quiet=false +template= while [ "$1" ]; do case "$1" in -o) out=$2 shift 2;; -q) quiet=true shift;; + -t) template="-t $2" + shift 2;; -*) usage;; *) break;; esac @@ -32,12 +37,12 @@ first=true for n in `sed '/\$Sheet/,/\$EndSheet/p;d' "$1" | sed '/F1 "\([^"]*\)" .*/s//\1/p;d'`; do $quiet || echo "$n" 1>&2 - ./sch2fig $libs `dirname "$1"`/$n | fig2dev -L pdf >_tmp.pdf + ./sch2fig $template $libs `dirname "$1"`/$n | fig2dev -L pdf >_tmp.pdf if $first; then mv _tmp.pdf "$out" first=false else - pdfunite out.pdf _tmp.pdf _tmp2.pdf + pdfunite "$out" _tmp.pdf _tmp2.pdf mv _tmp2.pdf "$out" fi done