1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/makesd-filter-def Mon Jun 10 01:37:46 2019 +0200
1.3 @@ -0,0 +1,47 @@
1.4 +#!/bin/sh
1.5 +
1.6 +# Filter sections of a complete definition.
1.7 +#
1.8 +# Copyright (C) 2019 Paul Boddie <paul@boddie.org.uk>
1.9 +#
1.10 +# This program is free software; you can redistribute it and/or modify it under
1.11 +# the terms of the GNU General Public License as published by the Free Software
1.12 +# Foundation; either version 3 of the License, or (at your option) any later
1.13 +# version.
1.14 +#
1.15 +# This program is distributed in the hope that it will be useful, but WITHOUT
1.16 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
1.17 +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
1.18 +# details.
1.19 +#
1.20 +# You should have received a copy of the GNU General Public License along with
1.21 +# this program. If not, see <http://www.gnu.org/licenses/>.
1.22 +
1.23 +PROGNAME=`basename "$0"`
1.24 +THISDIR=`dirname "$0"`
1.25 +
1.26 +COMMON="$THISDIR/makesd-common"
1.27 +
1.28 +. "$COMMON"
1.29 +
1.30 +
1.31 +
1.32 +# Obtain the requested system name.
1.33 +
1.34 +TYPE=$1
1.35 +
1.36 +if [ ! "$TYPE" ] || [ "$TYPE" = '--help' ] ; then
1.37 + cat 1>&2 <<EOF
1.38 +Usage: $PROGNAME <type> [ <property> ... ]
1.39 +
1.40 +Select sections of the given type from a complete description of a system
1.41 +provided on standard input. If any properties are given, select only those
1.42 +properties in the selected sections.
1.43 +EOF
1.44 + exit 1
1.45 +fi
1.46 +
1.47 +# Select sections of the given type, filtering out all other sections.
1.48 +
1.49 +filter $*
1.50 +exit $?