Convert uses of XKeycodeToKeysym (deprecated) to XkbKeycodeToKeysym
[oweals/cde.git] / cde / programs / dtprintegrate / dtlpsetup.src
1 XCOMM!/bin/sh
2 XCOMM
3 XCOMM $XConsortium: dtlpsetup.src /main/3 1996/04/23 12:01:59 drk $
4 XCOMM
5 XCOMM COMPONENT_NAME: desktop
6 XCOMM
7 XCOMM FUNCTIONS: dtlpsetup
8 XCOMM
9 XCOMM ORIGINS: 27 
10 XCOMM
11 XCOMM  (C) COPYRIGHT International Business Machines Corp. 1995
12 XCOMM  All Rights Reserved
13 XCOMM  US Government Users Restricted Rights - Use, duplication or
14 XCOMM  disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
15 XCOMM
16 XCOMM
17 XCOMM Add /usr/dt/lib/nls/msg/%L/%N.cat to NLSPATH
18 XCOMM
19
20 NLSPATH=/usr/dt/lib/nls/msg/%L/%N.cat:$NLSPATH
21 export NLSPATH
22
23 usage="$0 [-b banner_title] [-d lpdest] [-f print_file] 
24          [-m print_command] [-n copy_count] [-o other_options] 
25          [-u user_filename] [-a] [-e] [-h] [-r] [-s] [-v] [-w]"
26
27 while [ $# -gt 0 ]; do
28         case "$1" in
29         -b)
30                 if [ "$2" ]; then
31                   banner_title="$1 $2"
32                   shift; shift;
33                 else
34                   echo "$usage" 1>&2
35                   exit 2
36                 fi
37                 ;;
38         -b*)
39                 banner_title="-b $(expr "$1" : '-b\(.*\)')"
40                 shift
41                 ;;
42         -d)
43                 if [ "$2" ]; then
44                   lpdest="$1 $2"
45                   shift; shift;
46                 else
47                   echo "$usage" 1>&2
48                   exit 2
49                 fi
50                 ;;
51         -d*)
52                 lpdest="-d $(expr "$1" : '-d\(.*\)')"
53                 shift
54                 ;;
55         -c)
56                 NOT_SUPPORTED=true
57                 ARGS="$ARGS $1"
58                 if [ "$2" ]; then
59                   shift; shift;
60                 else
61                   shift
62                 fi
63                 ;;
64         -c*)
65                 NOT_SUPPORTED=true
66                 ARGS="$ARGS -c"
67                 shift
68                 ;;
69         -t)
70                 NOT_SUPPORTED=true
71                 ARGS="$ARGS $1"
72                 if [ "$2" ]; then
73                   shift; shift;
74                 else
75                   shift
76                 fi
77                 ;;
78         -t*)
79                 NOT_SUPPORTED=true
80                 ARGS="$ARGS -t"
81                 shift
82                 ;;
83         -i)
84                 NOT_SUPPORTED=true
85                 ARGS="$ARGS $1"
86                 if [ "$2" ]; then
87                   shift; shift;
88                 else
89                   shift
90                 fi
91                 ;;
92         -i*)
93                 NOT_SUPPORTED=true
94                 ARGS="$ARGS -i"
95                 shift
96                 ;;
97         -l)
98                 NOT_SUPPORTED=true
99                 ARGS="$ARGS $1"                
100                 if [ "$2" ]; then
101                   shift; shift;
102                 else
103                   shift
104                 fi
105                 ;;
106         -l*)
107                 NOT_SUPPORTED=true
108                 ARGS="$ARGS -l"
109                 shift
110                 ;;
111         -f)
112                 if [ "$2" ]; then
113                   print_file=$2
114                   shift; shift;
115                 else
116                   echo "$usage" 1>&2
117                   exit 2
118                 fi
119                 ;;
120         -f*)
121                 print_file=$(expr "$1" : '-f\(.*\)')
122                 shift
123                 ;;
124         -m)
125                 if [ "$2" ]; then
126                   print_command="$1 $2"
127                   shift; shift;
128                 else
129                   echo "$usage" 1>&2
130                   exit 2
131                 fi
132                 ;;
133         -m*)
134                 print_command="-m $(expr "$1" : '-m\(.*\)')"
135                 shift
136                 ;;
137         -n)
138                 if [ "$2" ]; then
139                   copy_count="$1 $2"
140                   shift; shift;
141                 else
142                   echo "$usage" 1>&2
143                   exit 2
144                 fi
145                 ;;
146         -n*)
147                 copy_count="-n $(expr "$1" : '-n\(.*\)')"
148                 shift
149                 ;;
150         -o)
151                 if [ "$2" ]; then
152                   other_options="$1 $2"
153                   shift; shift;
154                 else
155                   echo "$usage" 1>&2
156                   exit 2
157                 fi
158                 ;;
159         -o*)
160                 other_options="-o $(expr "$1" : '-o\(.*\)')"
161                 shift
162                 ;;
163         -u)
164                 if [ "$2" ]; then
165                   user_filename="$1 $2"
166                   shift; shift;
167                 else
168                   echo "$usage" 1>&2
169                   exit 2
170                 fi
171                 ;;
172         -u*)
173                 user_filename="-u $(expr "$1" : '-u\(.*\)')"
174                 shift
175                 ;;
176         -a)
177                 a=$1
178                 shift
179                 ;;
180         -e)
181                 e=$1
182                 shift
183                 ;;
184         -r)
185                 r=$1
186                 shift
187                 ;;
188         -s)
189                 s=$1
190                 shift
191                 ;;
192         -v)
193                 v=$1
194                 shift
195                 ;;
196         -w)
197                 w=$1
198                 shift
199                 ;;
200         -*)
201                 echo "$usage" 1>&2 
202                 exit 2
203                 ;;
204         *)
205                 break
206                 ;;
207         esac
208 done
209
210 if [ $# -gt 0 ]; then
211         echo "$usage" 1>&2 
212         exit 2
213 fi
214
215 if  [ $NOT_SUPPORTED ]; then
216   dspmsg -s 1 dtmigrate 2 "dtlpsetup: dtlpsetup has been replaced with dtlp.\
217 \tdtlp will be automatically called in its place. \
218 \tThe following flags and parameters on the dtlpsetup call \
219 \thave been ignored because dtlp does not support these flags: \
220 \t%1$s \n" "$ARGS"
221 fi
222
223 /usr/dt/bin/dtlp "$banner_title" "$lpdest" "$print_command" "$copy_count" "$other_options" "$user_filename" "$a" "$e" "$h" "$r" "$s" "$v" "$w" "$print_file"
224  
225 status=$?
226
227 XCOMM dtlp return code of 5 maps to return code 7 of dtlpsetup
228 if  [ $status -eq 5 ]
229   then exit NO_VALID_FILE_ERR
230 XCOMM dtlp return code of 6 maps to return code 8 of dtlpsetup
231 elif [ $status -eq 6 ]
232   then exit NO_READ_FILE_ERR
233 else
234 XCOMM all others are synonomous
235   exit $status
236 fi
237