How to pass parameters to the script from the command line

Asked by Dmitry

How to pass parameters to the script from the command line and how to use this parameter in a definite script?

It is necessary to pass parameter via command line.
This parameter will be used in a definite script in command "type"

it's possible ?

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
RaiMan (raimund-hocke) said :
#1
Revision history for this message
Dmitry (dmitry-remezow) said :
#2

I see this page
but i don't understand how it's works

Example
I want write some text as parameter via command line after "java -jar "%SIKULI_HOME%\sikuli-ide.jar" -r SomeTest.sikuli ".
How correct write this and how can this parameter use into "SomeTest.sikulli"

Revision history for this message
Best RaiMan (raimund-hocke) said :
#3

java -jar "%SIKULI_HOME%\sikuli-ide.jar" -r SomeTest.sikuli -- "some text" and this is someText too

yields 7 parameters going to sys.arv beginning at sys.argv[1]

this is written on the page - so what is wrong with that?

Command Line Options (intention: provide user parameters for running scripts)
-- <arguments>
the space delimeted and optionally quoted arguments are passed to Jython’s sys.argv and hence are available to your script

Revision history for this message
Dmitry (dmitry-remezow) said :
#4

Thanks RaiMan, that solved my question.