Open ianrodrigues opened 2 years ago
Faced the same issue today. Found out that in call()
cleo parses the arguments differently, e.g.
# trying to call command "x" with a required argument "value" as "100"
return_code = self.call("x", "100")
leads to the internal representation as
self._arguments: {'command': '100'} # not `x`!
though, when I call it from the terminal, the representation is:
# ./app.py x 100
self._arguments: {'command': 'x', 'value': '100'}
Eventually, I made it work with the following hack:
return_code = self.call("x", "x 100")
# inner:
self._arguments: {'command': 'x', 'value': '100'}
So, apparently the first word of the arguments is meaningless when calling a command.
return_code = self.call("x", "<anything> 100")
# inner:
self._arguments: {'command': '<anything>', 'value': '100'}
I'm using this sample
app.py
:When I'm calling the
foo
command itself, it works:But when I'm calling the
bar
command, I'm getting this:If I replace
self.call
byself.call_silent
that's the error: