I have a simple console application using the symfony console component.
I have two commands (e.g. cmdOne and cmdTwo ) that you can easily call on your own.
$ myApp.php cmdOne $ myApp.php cmdTwo
Both commands have a significant amount of output, which I can easily disable by issuing the -q option.
Now I would like cmdOne call cmdTwo , but I would like cmdTwo be quiet. I am not trying to do something crazy, but I am struggling to get there, despite reading the documents.
Here is my sample code (this snippet will be contained in cmdOne->execute() ):
$command = $this->getApplication()->find('cmdTwo'); $input = new ArrayInput(array( 'command' => 'cmdTwo', '-q' => true )); $returnCode = $command->run($input, $output);
This works fine, as in the code command, but it displays on the console (generated cmdTwo ) that I would not want to show.
The -q option indicates is impossible because it is "reserved" (that is, dev was not created), or am I missing something obvious?
source share