diff options
Diffstat (limited to 'bin/db2rpm-info')
-rwxr-xr-x | bin/db2rpm-info | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/bin/db2rpm-info b/bin/db2rpm-info index db1ed45..162fa26 100755 --- a/bin/db2rpm-info +++ b/bin/db2rpm-info @@ -1,8 +1,23 @@ -#!/bin/sh -BINDIR=`dirname $0` +#!/bin/zsh +ME=$(basename $0) +BINDIR=$(dirname $0) +USAGE="usage: ${ME} [-o ofile] document.xml" +ofile= +while getopts o: c +do + case "${c}" in + o) ofile="${OPTARG}";; + *) echo "${USAGE}" >&2; exit 1;; + esac +done +shift $(expr ${OPTIND} - 1) if [ $# -ne 1 ]; then - echo "usage: `basename $0` docfile.xml" >&2 + echo "${USAGE}" >&2 exit 1 fi +if [ "${ofile}" ]; then + rm -f "${ofile}" + exec >"${ofile}" +fi xsltproc ${BINDIR}/../packaging/info2rpminfo.xsl $1 | ${BINDIR}/xmlformat -f ${BINDIR}/xmlformat-fdp.conf |