#!/usr/bin/ksh
#
# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
#
# ident	"@(#)getmodels	1.2	07/11/09 SMI"
#

#
# get a list of the Models for this Model from the ppdcache
#
# Input:
#	Manufacturer	(Note: printmgr passes only the first word
#	Lexmark		of the manufacturer name)
# Output:
#	Manufacturer Model
#	Lexmark Optra Color 1200

if [[ $# -lt 1 ]]; then
        exit 1
fi

cachefile=/var/lp/ppd/ppdcache
[[ -f $cachefile ]] || exit 1
/bin/grep "^$1" $cachefile | nawk '{FS=":"; print $2}' | uniq 
exit 0
