wok-4.x view xarchive/stuff/slitaz-wrap.sh @ rev 2093
slitaz-configs: up DEPENDS for 1.0 to 2.0 upgrade (new desktop)
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Wed Jan 28 18:57:20 2009 +0100 (2009-01-28) |
parents | 52f4a751924a |
children | b538edb05596 |
line source
1 #!/bin/sh
2 # slitaz-wrap.sh - sh slitaz core wrapper for xarchive frontend
3 # Copyright (C) 2005 Lee Bigelow <ligelowbee@yahoo.com>
4 # Copyright (C) 2008 Pascal Bellard <pascal.bellard@slitaz.org>
5 #
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 # set up exit status variables
21 E_UNSUPPORTED=65
23 # Supported file extentions for tar
24 TAR_EXTS="tar"
25 GZIP_EXTS="tar.gz tgz"
26 LZMA_EXTS="tar.lz tar.lzma tlz"
27 BZIP2_EXTS="tar.bz tbz tar.bz2 tbz2"
28 COMPRESS_EXTS="tar.z tar.Z"
29 IPK_EXTS="ipk"
30 CPIO_EXTS="cpio"
31 CPIOGZ_EXTS="cpio.gz"
32 ZIP_EXTS="zip cbz jar"
33 RPM_EXTS="rpm"
34 DEB_EXTS="deb"
35 TAZPKG_EXTS="tazpkg"
36 ISO_EXTS="iso"
37 SQUASHFS_EXTS="sqfs squashfs"
38 CROMFS_EXTS="cromfs"
39 FS_EXTS="ext2 ext3 dos fat vfat fd fs loop"
40 CLOOP_EXTS="cloop"
42 # Setup awk program
43 AWK_PROGS="mawk gawk awk"
44 AWK_PROG=""
45 for awkprog in $AWK_PROGS; do
46 if [ "$(which $awkprog)" ]; then
47 AWK_PROG="$awkprog"
48 break
49 fi
50 done
52 # setup variables opt and archive.
53 # the shifting will leave the files passed as
54 # all the remaining args "$@"
55 opt="$1"
56 test -z $1 || shift 1
57 archive="$1"
58 test -z $1 || shift 1
60 decompress_ipk()
61 {
62 tar xOzf "$1" ./data.tar.gz | gzip -dc
63 }
65 # set up compression variables for our compression functions.
66 # translate archive name to lower case for pattern matching.
67 # use compressor -c option to output to stdout and direct it where we want
68 lc_archive="$(echo $archive|tr [:upper:] [:lower:])"
69 DECOMPRESS="cat"
70 COMPRESS="cat"
71 for ext in $IPK_EXTS; do
72 if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then
73 DECOMPRESS="decompress_ipk"
74 fi
75 done
76 for ext in $GZIP_EXTS $CPIOGZ_EXTS; do
77 if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then
78 DECOMPRESS="gzip -dc"
79 COMPRESS="gzip -c"
80 fi
81 done
82 for ext in $BZIP2_EXTS; do
83 if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then
84 DECOMPRESS="bzip2 -dc"
85 COMPRESS="bzip2 -c"
86 fi
87 done
88 for ext in $LZMA_EXTS; do
89 if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then
90 DECOMPRESS="unlzma -c"
91 COMPRESS="lzma e -si -so"
92 fi
93 done
94 for ext in $COMPRESS_EXTS; do
95 if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then
96 DECOMPRESS="uncompress -dc"
97 COMPRESS="compress -c"
98 fi
99 done
101 # Compression functions
102 decompress_func()
103 {
104 if [ "$DECOMPRESS" ]; then
105 tmpname="$(mktemp -t tartmp.XXXXXX)"
106 if [ -f "$archive" ]; then
107 $DECOMPRESS "$archive" > "$tmpname"
108 fi
109 # store old name for when we recompress
110 oldarch="$archive"
111 # change working file to decompressed tmp
112 archive="$tmpname"
113 fi
114 }
116 compress_func()
117 {
118 if [ "$COMPRESS" ] && [ "$oldarch" ]; then
119 [ -f "$oldarch" ] && rm "$oldarch"
120 if $COMPRESS < "$archive" > "$oldarch"; then
121 rm "$archive"
122 fi
123 fi
124 }
126 not_busybox()
127 {
128 case "$(readlink $(which $1))" in
129 *busybox*) return 1;;
130 esac
131 return 0
132 }
134 add_file()
135 {
136 ( cd $2 ; tar -cf - $1 ) | tar -xf -
137 }
139 remove_file()
140 {
141 rm -rf ./$1
142 }
144 update_tar_cpio()
145 {
146 action=$1
147 shift
148 tardir="$(dirname "$archive")"
149 for ext in $TAR_EXTS $GZIP_EXTS $BZIP2_EXTS $COMPRESS_EXTS $LZMA_EXTS; do
150 if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then
151 if [ "$action" = "new_archive" ]; then
152 decompress_func
153 cd "$tardir"
154 tar -cf "$archive" "${1#$tardir/}"
155 status=$?
156 compress_func
157 exit $status
158 fi
159 if not_busybox tar; then
160 decompress_func
161 case "$action" in
162 remove_file)
163 tar --delete -f "$archive" "$@";;
164 add_file)
165 cd "$tardir"
166 tar -rf "$archive" "${1#$tardir/}";;
167 *) false;;
168 esac
169 status=$?
170 compress_func
171 exit $status
172 fi
173 tmptar="$(mktemp -d -t tartmp.XXXXXX)"
174 here="$(pwd)"
175 cd $tmptar
176 $DECOMPRESS < "$archive" | tar -xf -
177 status=$?
178 if [ $status -eq 0 -a -n "$1" ]; then
179 while [ "$1" ]; do
180 $action "${1#$tardir/}" $here
181 shift
182 done
183 tar -cf - $(ls -a | grep -v ^\.$ | grep -v ^\.\.$) | \
184 $COMPRESS > "$archive"
185 status=$?
186 fi
187 cd $here
188 rm -rf $tmptar
189 exit $status
190 fi
191 done
192 for ext in $CPIO_EXTS $CPIOGZ_EXTS; do
193 if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then
194 if [ "$action" = "new_archive" ]; then
195 decompress_func
196 cd "$tardir"
197 echo "${1#$tardir/}" | cpio -o -H newc > "$archive"
198 status=$?
199 compress_func
200 exit $status
201 fi
202 tmpcpio="$(mktemp -d -t cpiotmp.XXXXXX)"
203 here="$(pwd)"
204 cd $tmpcpio
205 $DECOMPRESS "$archive" | cpio -id > /dev/null
206 status=$?
207 if [ $status -eq 0 -a -n "$1" ]; then
208 while [ "$1" ]; do
209 $action "${1#$tardir/}" $here
210 shift
211 done
212 find . | cpio -o -H newc | $COMPRESS > "$archive"
213 status=$?
214 fi
215 cd $here
216 rm -rf $tmpcpio
217 exit $status
218 fi
219 done
220 }
222 loop_fs()
223 {
224 tmpfs="$(mktemp -d -t fstmp.XXXXXX)"
225 umnt="umount -d"
226 case " $CLOOP_EXTS " in
227 \ $1\ ) mount -o loop=/dev/cloop,ro "$archive" $tmpfs;;
228 esac
229 case " $FS_EXTS " in
230 \ $1\ ) mount -o loop,rw "$archive" $tmpfs;;
231 esac
232 case " $ISO_EXTS " in
233 \ $1\ ) mount -o loop,ro -t iso9660 "$archive" $tmpfs;;
234 esac
235 case " $SQUASHFS_EXTS " in
236 \ $1\ ) mount -o loop,ro -t squashfs "$archive" $tmpfs;;
237 esac
238 case " $CROMFS_EXTS " in
239 \ $1\ ) cromfs-driver "$archive" $tmpfs; umnt="fusermount -u";;
240 esac
241 case "$2" in
242 stat) find $tmpfs | while read f; do
243 [ "$f" = "$tmpfs" ] && continue
244 link="-"
245 [ -L "$f" ] && link=$(readlink "$f")
246 date=$(stat -c "%y" $f | awk \
247 '{ printf "%s;%s\n",$1,substr($2,0,8)}')
248 echo "${f#$tmpfs/};$(stat -c "%s;%A;%U;%G" $f);$date;$link"
249 done;;
250 copy) if [ -z "$3" ]; then
251 ( cd $tmpfs ; tar cf - . ) | tar xf -
252 else
253 while [ -n "$3" ]; do
254 ( cd $tmpfs ; tar cf - "$3" ) | tar xf -
255 shift;
256 done
257 fi;;
258 add) tar cf - "$@" | ( cd $tmpfs ; tar xf - );;
259 remove) while [ -n "$3" ]; do
260 rm -rf $tmpfs/$3
261 done;;
262 esac
263 $umnt $tmpfs
264 rmdir $tmpfs
265 }
267 # the option switches
268 case "$opt" in
269 -i) # info: output supported extentions for progs that exist
270 for ext in $TAR_EXTS $GZIP_EXTS $BZIP2_EXTS $COMPRESS_EXTS $LZMA_EXTS \
271 $CPIO_EXTS $CPIOGZ_EXTS $ZIP_EXTS $DEB_EXTS $RPM_EXTS \
272 $TAZPKG_EXTS $ISO_EXTS $FS_EXTS $IPK_EXTS; do
273 printf "%s;" $ext
274 if [ "$ext" = "zip" -a ! "$(which zip)" ]; then
275 echo warning: zip not found, extract only >/dev/stderr
276 fi
277 done
278 [ -d /lib/modules/$(uname -r)/kernel/fs/squashfs/squashfs.ko ] && \
279 for ext in $SQUASHFS_EXTS; do
280 printf "%s;" $ext
281 done
282 [ -x /bin/cromfs-driver ] && for ext in $CROMFS_EXTS; do
283 printf "%s;" $ext
284 done
285 [ -d /lib/modules/$(uname -r)/kernel/drivers/block/cloop.ko ] && \
286 for ext in $CLOOP_EXTS; do
287 printf "%s;" $ext
288 done
289 printf "\n"
290 exit
291 ;;
293 -o) # open: mangle output of tar cmd for xarchive
294 for ext in $TAR_EXTS $GZIP_EXTS $BZIP2_EXTS $COMPRESS_EXTS $LZMA_EXTS \
295 $IPK_EXTS; do
296 # format of tar output:
297 # lrwxrwxrwx USR/GRP 0 2005-05-12 00:32:03 file -> /path/to/link
298 # -rw-r--r-- USR/GRP 6622 2005-04-22 12:29:14 file
299 # 1 2 3 4 5 6
300 if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then
301 $DECOMPRESS "$archive" | tar -tvf - | $AWK_PROG '
302 {
303 attr=$1
304 split($2,ids,"/") #split up the 2nd field to get uid/gid
305 uid=ids[1]
306 gid=ids[2]
307 size=$3
308 date=$4
309 time=$5
311 #this method works with filenames that start with a space (evil!)
312 #split line a time and a space
313 split($0,linesplit, $5 " ")
314 #then split the second item (name&link) at the space arrow space
315 split(linesplit[2], nlsplit, " -> ")
317 name=nlsplit[1]
318 link=nlsplit[2]
320 if (! link) {link="-"} #if there was no link set it to a dash
322 printf "%s;%s;%s;%s;%s;%s;%s;%s\n",name,size,attr,uid,gid,date,time,link
323 }'
324 exit
325 fi
326 done
328 for ext in $CPIO_EXTS $CPIOGZ_EXTS; do
329 # format of cpio output:
330 # lrwxrwxrwx USR/GRP 0 2005-05-12 00:32:03 file -> /path/to/link
331 # -rw-r--r-- USR/GRP 6622 2005-04-22 12:29:14 file
332 # 1 2 3 4 5 6
333 if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then
334 $DECOMPRESS "$archive" | cpio -tv | $AWK_PROG '
335 {
336 attr=$1
337 split($2,ids,"/") #split up the 2nd field to get uid/gid
338 uid=ids[1]
339 gid=ids[2]
340 size=$3
341 date=$4
342 time=$5
344 #this method works with filenames that start with a space (evil!)
345 #split line a time and a space
346 split($0,linesplit, $5 " ")
347 #then split the second item (name&link) at the space arrow space
348 split(linesplit[2], nlsplit, " -> ")
350 name=nlsplit[1]
351 link=nlsplit[2]
353 if (! link) {link="-"} #if there was no link set it to a dash
355 if (name != "" && uid != "blocks") printf "%s;%s;%s;%s;%s;%s;%s;%s\n",name,size,attr,uid,gid,date,time,link
356 }'
357 exit
358 fi
359 done
361 for ext in $ZIP_EXTS; do
362 if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then
363 if which zipinfo; then
364 # format of zipinfo -T -s-h- output:
365 # -rw-r--r-- 2.3 unx 11512 tx defN YYYYMMDD.HHMMSS file
366 # 1 2 3 4 5 6 7 8
367 zipinfo -T -s-h-t "$archive" | $AWK_PROG -v uuid=$(id -u -n) '
368 {
369 attr=$1; size=$4
371 year=substr($7,1,4)
372 month=substr($7,5,2)
373 day=substr($7,7,2)
374 date=year "-" month "-" day
376 hours=substr($7,10,2)
377 mins=substr($7,12,2)
378 secs=substr($7,14,2)
379 time=hours ":" mins ":" secs
381 uid=uuid; gid=uuid; link="-"
382 #split line at the time and a space, second item is our name
383 split($0, linesplit, ($7 " "))
384 name=linesplit[2]
385 printf "%s;%s;%s;%s;%s;%s;%s;%s\n",name,size,attr,uid,gid,date,time,link
386 }'
387 exit
388 else
389 # format of unzip -l output:
390 # 6622 2005-04-22 12:29:14 file
391 # 1 2 3 4
392 unzip -l "$archive" | $AWK_PROG -v uuid=$(id -u -n) '
393 BEGIN { n = 0}
394 {
395 n=n+1
396 attr=""
397 uid=uuid; gid=uuid
398 size=$1
399 date=$2
400 time=$3
402 #this method works with filenames that start with a space (evil!)
403 #split line a time and a space
404 split($0,linesplit, $3 " ")
405 #then split the second item (name&link) at the space arrow space
406 split(linesplit[2], nlsplit, " -> ")
408 name=nlsplit[1]
409 link=nlsplit[2]
411 if (! link) {link="-"} #if there was no link set it to a dash
413 if (name != "" && n > 3) printf "%s;%s;%s;%s;%s;%s;%s;%s\n",name,size,attr,uid,gid,date,time,link
414 }'
415 exit
416 fi
417 fi
418 done
420 for ext in $RPM_EXTS; do
421 if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then
422 rpm2cpio "$archive" | cpio -tv | $AWK_PROG '
423 {
424 attr=$1
425 split($2,ids,"/") #split up the 2nd field to get uid/gid
426 uid=ids[1]
427 gid=ids[2]
428 size=$3
429 date=$4
430 time=$5
432 #this method works with filenames that start with a space (evil!)
433 #split line a time and a space
434 split($0,linesplit, $5 " ")
435 #then split the second item (name&link) at the space arrow space
436 split(linesplit[2], nlsplit, " -> ")
438 name=substr(nlsplit[1],2)
439 link=nlsplit[2]
441 if (! link) {link="-"} #if there was no link set it to a dash
443 if (name != "" && uid != "blocks") printf "%s;%s;%s;%s;%s;%s;%s;%s\n",name,size,attr,uid,gid,date,time,link
444 }'
445 exit
446 fi
447 done
449 for ext in $DEB_EXTS; do
450 if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then
451 dpkg-deb -c "$archive" | $AWK_PROG '
452 {
453 attr=$1
454 split($2,ids,"/") #split up the 2nd field to get uid/gid
455 uid=ids[1]
456 gid=ids[2]
457 size=$3
458 date=$4
459 time=$5
461 #this method works with filenames that start with a space (evil!)
462 #split line a time and a space
463 split($0,linesplit, $5 " ")
464 #then split the second item (name&link) at the space arrow space
465 split(linesplit[2], nlsplit, " -> ")
467 name=substr(nlsplit[1],2)
468 link=nlsplit[2]
470 if (! link) {link="-"} #if there was no link set it to a dash
472 printf "%s;%s;%s;%s;%s;%s;%s;%s\n",name,size,attr,uid,gid,date,time,link
473 }'
474 exit
475 fi
476 done
478 for ext in $TAZPKG_EXTS; do
479 # format of cpio output:
480 # lrwxrwxrwx USR/GRP 0 2005-05-12 00:32:03 file -> /path/to/link
481 # -rw-r--r-- USR/GRP 6622 2005-04-22 12:29:14 file
482 # 1 2 3 4 5 6
483 if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then
484 tmpcpio="$(mktemp -d -t cpiotmp.XXXXXX)"
485 here="$(pwd)"
486 cd $tmpcpio
487 cpio -i fs.cpio.gz > /dev/null < "$archive"
488 zcat fs.cpio.gz | cpio -tv | $AWK_PROG '
489 {
490 attr=$1
491 split($2,ids,"/") #split up the 2nd field to get uid/gid
492 uid=ids[1]
493 gid=ids[2]
494 size=$3
495 date=$4
496 time=$5
498 #this method works with filenames that start with a space (evil!)
499 #split line a time and a space
500 split($0,linesplit, $5 " ")
501 #then split the second item (name&link) at the space arrow space
502 split(linesplit[2], nlsplit, " -> ")
504 name=substr(nlsplit[1],3)
505 link=nlsplit[2]
507 if (! link) {link="-"} #if there was no link set it to a dash
509 if (name != "" && uid != "blocks") printf "%s;%s;%s;%s;%s;%s;%s;%s\n",name,size,attr,uid,gid,date,time,link
510 }'
511 cd $here
512 rm -rf $tmpcpio
513 exit
514 fi
515 done
517 for ext in $ISO_EXTS $SQUASHFS_EXTS $CROMFS_EXTS $CLOOP_EXTS $FS_EXTS; do
518 if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then
519 loop_fs $ext stat
520 exit
521 fi
522 done
523 exit $E_UNSUPPORTED
524 ;;
526 -a) # add to archive passed files
527 update_tar_cpio add_file "$@"
528 for ext in $FS_EXTS; do
529 if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then
530 loop_fs $ext add "$@"
531 exit 0
532 fi
533 done
534 which zip >/dev/null && for ext in $ZIP_EXTS; do
535 if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then
536 # we only want to add the file's basename, not
537 # the full path so...
538 while [ "$1" ]; do
539 cd "$(dirname "$1")"
540 zip -g -r "$archive" "$(basename "$1")"
541 wrapper_status=$?
542 shift 1
543 done
544 exit $wrapper_status
545 fi
546 done
547 exit $E_UNSUPPORTED
548 ;;
550 -n) # new: create new archive with passed files
551 update_tar_cpio new_archive "$@"
552 which zip >/dev/null && for ext in $ZIP_EXTS; do
553 if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then
554 # create will only be passed the first file, the
555 # rest will be "added" to the new archive
556 cd "$(dirname "$1")"
557 zip -r "$archive" "$(basename "$1")"
558 fi
559 done
560 exit $E_UNSUPPORTED
561 ;;
563 -r) # remove: from archive passed files
564 update_tar_cpio remove_file "$@"
565 for ext in $FS_EXTS; do
566 if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then
567 loop_fs $ext remove "$@"
568 exit 0
569 fi
570 done
571 which zip >/dev/null && for ext in $ZIP_EXTS; do
572 if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then
573 zip -d "$archive" "$@"
574 fi
575 done
576 exit $E_UNSUPPORTED
577 ;;
579 -e) # extract: from archive passed files
580 for ext in $TAR_EXTS $GZIP_EXTS $BZIP2_EXTS $COMPRESS_EXTS $LZMA_EXTS \
581 $IPK_EXTS; do
582 if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then
583 # xarchive will put is the right extract dir
584 # so we just have to extract.
585 $DECOMPRESS "$archive" | tar -xf - "$@"
586 exit $?
587 fi
588 done
589 for ext in $CPIO_EXTS $CPIOGZ_EXTS; do
590 if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then
591 if [ -n "$1" ]; then
592 while [ "$1" ]; do
593 $DECOMPRESS "$archive" | cpio -idv "$1"
594 shift 1
595 done
596 else
597 $DECOMPRESS "$archive" | cpio -idv
598 fi
599 exit $?
600 fi
601 done
602 for ext in $ZIP_EXTS; do
603 if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then
604 # xarchive will put is the right extract dir
605 # so we just have to extract.
606 unzip -n "$archive" "$@"
607 exit $?
608 fi
609 done
610 for ext in $RPM_EXTS; do
611 if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then
612 if [ -n "$1" ]; then
613 while [ "$1" ]; do
614 rpm2cpio "$archive" | cpio -idv "$1"
615 shift 1
616 done
617 else
618 rpm2cpio "$archive" | cpio -idv
619 fi
620 exit $?
621 fi
622 done
624 for ext in $DEB_EXTS; do
625 if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then
626 dpkg-deb -X "$archive" "$@"
627 exit $?
628 fi
629 done
630 for ext in $TAZPKG_EXTS; do
631 if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then
632 tmpcpio="$(mktemp -d -t cpiotmp.XXXXXX)"
633 here="$(pwd)"
634 cd $tmpcpio
635 cpio -i < "$archive" > /dev/null
636 zcat fs.cpio.gz | cpio -id > /dev/null
637 status=$?
638 if [ -n "$1" ]; then
639 while [ "$1" ]; do
640 dir=$(dirname "$here/$1")
641 mkdir -p "$dir" 2> /dev/null
642 mv "fs/$1" "$dir" 2> /dev/null
643 done
644 else
645 mv fs/* fs/.* $here 2> /dev/null
646 fi
647 cd $here
648 rm -rf $tmpcpio
649 exit $status
650 fi
651 done
652 for ext in $ISO_EXTS $SQUASHFS_EXTS $CROMFS_EXTS $CLOOP_EXTS $FS_EXTS; do
653 if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then
654 loop_fs $ext copy "$@"
655 exit 0
656 fi
657 done
658 exit $E_UNSUPPORTED
659 ;;
661 *) echo "error, option $opt not supported"
662 echo "use one of these:"
663 echo "-i #info"
664 echo "-o archive #open"
665 echo "-a archive files #add"
666 echo "-n archive file #new"
667 echo "-r archive files #remove"
668 echo "-e archive files #extract"
669 exit
670 esac