comand line quoted parameters don't work

Asked by Luiz Carlos Modesto

I wrote a simple test por pass user parameters by command line in Windows. For one-word parameters it works ok, but when I quote parameters to include spaces in values, sikulix is ignoring my quotes. In fact it treats quotes as part of each parameter, as it does to any other character.

The command line used is like this:
<path>runsikulix.cmd -r <path to script.sikuli> -- 'par 1' 'par 2'

My script is this:
import sys
for arg in sys.argv:
    print arg
popup("see what u got.")

The result is this:
'par
1'
'par
2'

So, I conclude that sikulix treated my command line as containing 4 parameters.

I'm using Sikulix 1.1.0 Build: 2015-09-15_01:00nightly

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
Best RaiMan (raimund-hocke) said :
#1

use apostrophes:

runsikulix.cmd -r <path to script.sikuli> -- "par 1" "par 2"

Revision history for this message
Luiz Carlos Modesto (luiz-carlos-modesto) said :
#2

Thanks RaiMan, that solved my question.