[1.0.1 ok] Windows: Command line arguments cut off

Bug #1199798 reported by Andrew Ohm on 2013-07-10
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

--- fixed with 1.0.1


Sorry if this has been reported or fixed already, but it appears I am having issues running scripts with a few command line parameters.

For instance:

C:\Windows\system32>c:\Sikuli\Sikuli\sikuli-script.cmd -j6 -r c:\Sikuli\test.sikuli --args -w 2 -it 2 -te Cash -sa -c -re
-Xms64M -Xmx512M -Dfile.encoding=UTF-8
-r c:\Sikuli\test.sikuli --args -w 2 -it 2 -te Cash -sa
+++ using as SIKULIX_HOME: c:\Sikuli\Sikuli\

Note the actual command I use is being truncated. This isn't a visual thing only, those parameters actually were not passed.

What's interesting, is this seems like a maximum character thing, as opposed to maximum arguments. For instance if I remove the "-te Cash" part, I get "room" for two extra command line arguments:

C:\Windows\system32>c:\Sikuli\Sikuli\sikuli-script.cmd -j6 -r c:\Sikuli\test.sikuli --args -w 2 -it 2 -sa -c -re
-Xms64M -Xmx512M -Dfile.encoding=UTF-8
-r c:\Sikuli\test.sikuli --args -w 2 -it 2 -sa -c -re
+++ using as SIKULIX_HOME: c:\Sikuli\Sikuli\
+++ this Sikuli version is 32-Bit

Could this be fixed for 1.1? If a temporary fix or workaround is available that I or others who stumble upon this issue have, that'd be awesome too.

Andrew Ohm (aohm) on 2013-07-10
description: updated
Andrew Ohm (aohm) on 2013-07-10
summary: - Command line arguments cut off
+ [1.0]Command line arguments cut off
summary: - [1.0]Command line arguments cut off
+ [1.0] Command line arguments cut off

I will check and guess I will have fixed it already for the service update 1.0.1 end of July.

If I find any workaround earlier, I let you know.

Changed in sikuli:
status: New → Fix Committed
importance: Undecided → High
assignee: nobody → RaiMan (raimund-hocke)
milestone: none → 1.1.0
Andrew Ohm (aohm) wrote :

Awesome, a 1.0.1 service update of sorts, a workaround, or using 1.1's beta which I believe is coming up, are all viable solutions for me.

For the record, your blueprint to have the IDE itself able to work with Command Line args will be most useful in how we are using Sikuli :)


RaiMan (raimund-hocke) wrote :

Thanks for the hint ;-)

The IDE (meaning sikuli-ide.jar) is no longer intended to run scripts from command line. This is the job of sikuli-script.jar.

Nevertheless might it be of value in some situation to start the IDE with some command line parameters, that are available in the IDE, when running scripts as a global sys.argv.
This will be available plus the feature to edit these command line parameters prior to a script run in the IDE specific for each tab.

I plan to have something like the Maven pom's as configuration/preferences/setup/preset for the IDE and sikuli-script (XML or JSON format): if such a sikuli.config is in the same directory as the script or given by some commandline parameter, it will be used in this sense.

RaiMan (raimund-hocke) wrote :

The problem is the implementation (quick and dirty ;-) of the Windows command file sikuli-script.cmd, that allows only 9 entries after the parameter -r (including script name).

A current workaround would be to use the generated java command directly or a stripped down command file version like this:
@echo off
set JAVA=... path to the java.exe to be used
set PARMS=-Xms64M -Xmx512M -Dfile.encoding=UTF-8

%JAVA% %PARMS% -cp "%SIKULIX_HOME%sikuli-script.jar" org.sikuli.script.SikuliScript %*

RaiMan (raimund-hocke) on 2013-07-16
tags: added: scriptrun
removed: arguments
summary: - [1.0] Command line arguments cut off
+ [1.0] Windows: Command line arguments cut off
RaiMan (raimund-hocke) on 2013-07-16
Changed in sikuli:
importance: High → Critical
description: updated
RaiMan (raimund-hocke) on 2013-08-14
summary: - [1.0] Windows: Command line arguments cut off
+ [1.0.1 ok] Windows: Command line arguments cut off
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers