.key DIRECTORY/A,INTERACTIVE/S,OPT1,OPT2,OPT3
.bra {
.ket }

; $VER: lha2lzx-dir 1.1 (01.04.95) by Ralph Seichter
;
; This script will unpack all LhA archives in a given directory and
; re-pack them using the lha2lzx script. In the default mode, there is
; no user interaction involved, but if precise control is required, you
; can use the INTERACTIVE switch.
;
; INSTALLATION:
;
; You should copy lha2lzx-dir to your S: directory or any other directory
; in your command path. Make surce that the script bit is set, or you'll
; have to invoke it with "Execute lha2lzx-dir".
;
; USAGE EXAMPLE:
;
; Best compression is obtained by invoking the script as follows:
;
;      lha2lzx-dir <directory> -3

if "{INTERACTIVE}" eq ""
	echo "*NPlease note that this mode of operation doesn't allow any user interaction."
	echo "If you want to stop it, press Ctrl-C *E[1mwhile a LhA archive is being unpacked.*E[0m*N"
	set mode FORCE
else
	set mode ""
endif

set tmpname lha2lzx-dir$process
assign $tmpname: ""
cd {DIRECTORY}
list #?.lha lformat "lha2lzx %N %M.lzx $mode {OPT1} {OPT2} {OPT3}" > t:$tmpname
execute t:$tmpname
delete t:$tmpname
cd $tmpname:
assign $tmpname:

unset mode
unset tmpname

; EOF
