1 #!/bin/sh 2 3 # Filter sections of a complete definition. 4 # 5 # Copyright (C) 2019 Paul Boddie <paul@boddie.org.uk> 6 # 7 # This program is free software; you can redistribute it and/or modify it under 8 # the terms of the GNU General Public License as published by the Free Software 9 # Foundation; either version 3 of the License, or (at your option) any later 10 # version. 11 # 12 # This program is distributed in the hope that it will be useful, but WITHOUT 13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 15 # details. 16 # 17 # You should have received a copy of the GNU General Public License along with 18 # this program. If not, see <http://www.gnu.org/licenses/>. 19 20 PROGNAME=`basename "$0"` 21 THISDIR=`dirname "$0"` 22 23 COMMON="$THISDIR/makesd-common" 24 25 . "$COMMON" 26 27 28 29 # Obtain the requested system name. 30 31 TYPE=$1 32 33 if [ ! "$TYPE" ] || [ "$TYPE" = '--help' ] ; then 34 cat 1>&2 <<EOF 35 Usage: $PROGNAME <type> [ <property> ... ] 36 37 Select sections of the given type from a complete description of a system 38 provided on standard input. If any properties are given, select only those 39 properties in the selected sections. 40 EOF 41 exit 1 42 fi 43 44 # Select sections of the given type, filtering out all other sections. 45 46 filter $* 47 exit $?