9

有没有办法将选项定义为包含空格的字符串,像这样

$myscript.php test --comment="some string"

它输出:

[RuntimeException]   
Too many arguments.

test [-c|--comment="..."]

但是,如果 --comment 不包含空格(例如:“some_string”),它会起作用。

4

2 回答 2

1

我遇到了同样的问题。也许您myscript.php以错误的方式传递论点。在 github 上检查这个问题:https ://github.com/symfony/symfony/issues/11205

于 2015-02-16T14:59:15.520 回答
0

不,这与 Symfony 无关。这是关于命令行的。只需继续传递带引号的字符串。

于 2013-09-01T21:34:38.210 回答