@echo off
echo removing excess blank lines on all files in %_CWD directory
set tree=false
if "%1" == "tree" set tree=true
if "%1" == "-tree" set tree=true
if "%1" == "/tree" set tree=true
if "%2" == "tree" set tree=true
if "%2" == "-tree" set tree=true
if "%2" == "/tree" set tree=true
if "%tree" == "true" echo and all subdirectories too
if "%tree" == "false" echo without subdirectories
set compact=
if "%1" == "compact" set compact=-compact
if "%1" == "/compact" set compact=-compact
if "%1" == "-compact" set compact=-compact
if "%2" == "compact" set compact=-compact
if "%2" == "/compact" set compact=-compact
if "%2" == "-compact" set compact=-compact
if "%compact" == "-compact" echo compacting out all blank lines, not just excess.
set exts=*.asm;*.bat;*.batfrag;*.btm;*.btmfrag;*.c;*.cpp;*.dtd;*.dtdfrag;*.h;*.hpp;*.html;*.htmlfrag;*.java;*.javafrag;*.jnlp;*.jnlpfrag;*.list;*.pml;*.sql;*.sqlfrag;*.txt;*.use;*.xml;*.xmlfrag;*.xsd;*.xsdfrag
if "%tree" == "true" ( for /r /h /a:-d %f in (%exts) do blout.exe %compact %f
) else (
for /h /a:-d %f in (%exts) do blout.exe %f )
if "%tree" == "true" ( untouch -q -s .
) else (
untouch -q . )