views:

493

answers:

1

Hello,

I am trying to use Shoes and I need to pass it command-line parameters (basically, my Shoes app will be called from another pre-existing app and this would allow me to pre-fill some parts of shoes). Should I then call it using bin/shoes wrapper?

It seems I can not pass arguments to shoes wrapper (it concatenates all parameters and tries to use the result as a script path name). And I can't seem to be able to access ARGV array.

 Juraj.
+1  A: 

The code sample

Shoes.app do
  para "program: #{ARGV[0]}\n"
  para "arg1: #{ARGV[1]}\n"
  para "arg2: #{ARGV[2]}\n"
end

works for me when called from the wrapper shoes.run. For example, if I run ./shoes.run test.app foo bar on the command line, it displays:

program: test.app
arg1: foo
arg2: bar

for me. Perhaps your concatenation behavior is related to how you are calling Shoes, and not to the Shoes wrapper itself?

Also, the same works for me if I run shoes after unpacking everything. Also, you can run

shoes test.app -- foo bar

to insure that the app gets the arguments instead of the shoes executable.

A. Rex