3

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.
4

1 回答 1

4

代码示例

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

从包装器调用时为我工作shoes.run。例如,如果我./shoes.run test.app foo bar在命令行上运行,它会显示:

program: test.app
arg1: foo
arg2: bar

为了我。也许您的连接行为与您如何调用 Shoes 相关,而不是与 Shoes 包装器本身有关?

shoes此外,如果我在打开所有东西后运行,这同样适用于我。此外,您可以运行

shoes test.app -- foo bar

以确保应用程序获取参数而不是鞋子可执行文件。

于 2009-01-09T06:34:53.450 回答