hi. Can somebody help to understand how use events in cli? for both console:beforeHandleTask and console:afterHandleTask. I write so
$app = new Console();
$eventsManager = $di->getShared('eventsManager');
$eventsManager->attach('console:beforeHandleTask', new CliPlugin());
$eventsManager->attach('console:afterHandleTask', new CliPlugin());
$app->setEventsManager($eventsManager);
beforeHandleTask fires, but afterHandleTask no. Where is my error?