public function beforeHandleTask($argv)
    {
        return function(Event $event, Console $console, Dispatcher $dispatcher) use ($argv) {
            //parse parameters
            $parsedOptions = OptionParser::parse($argv);

            $dispatcher->setParams(array(
                'activeTask'  => isset($parsedOptions[0]) ? $parsedOptions[0] : false,
                'activeAction'  => isset($parsedOptions[1]) ? $parsedOptions[1] : false,
                'args'    =>  count($parsedOptions) > 2 ? array_slice($parsedOptions, 2) : []
            ));
        };
    }