Message1468

Author pekka.klarck
Recipients
Date 2007-02-16.11:05:47
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
jython.bat script has a bit ugly loop (well, batch scripts are always ugly) for processing arguments given to it. The script I have has following contents.

"""
set ARGS=

:loop
if [%1] == [] goto end
    set ARGS=%ARGS% %1
    shift
    goto loop
:end

"C:\Program Files\Java\jre1.5.0_10\bin\java.exe" -Dpython.home="C:\jython2.2b1" -classpath "C:\jython2.2b1\jython.jar;%CLASSPATH%" org.python.util.jython %ARGS%
"""

At least on Win XP all arguments given to a batch script are available in special variable %* (similarly as in bash they are in $*). The above code could thus be simplified significantly into following.

"""
"C:\Program Files\Java\jre1.5.0_10\bin\java.exe" -Dpython.home="C:\jython2.2b1" -classpath "C:\jython2.2b1\jython.jar;%CLASSPATH%" org.python.util.jython %*
"""

People playing with Jython a bit more (e.g. wanting to update Java it uses) are likely to investigate jython.bat script at some point and making it simpler would thus be nice.

Of course it should first be tested does %* work in other Windows versions than XP. I assume it works on NT based versions but I'm worried about 95/98/ME series. Installer could of course have different versions of jython.bat for different Windows versions but that may be an overkill.

History
Date User Action Args
2008-02-20 17:17:44adminlinkissue1661420 messages
2008-02-20 17:17:44admincreate