src/Application.php
public function handleCLIRequest()
    {
        $cli = new CLI\CLI;
        $cli->addOption("r", "run", "action", "Run the specified task");
        $cli->addOption("s", "list", false, "List the available tasks");
        $opts = $cli->parse($_SERVER['argv']);

        if (isset($opts['help']))
            $cli->syntax("");

        $taskrunner = new Task\TaskRunner($this);
        if ($opts->has('list'))
        {
            $taskrunner->listTasks();
            exit();
        }

        if (!$opts->has('run'))
            $cli->syntax("Please specify the action to run");

        $taskrunner->run($opts->get('run'));
    }
public function handleCLIRequest()
    {
        $cli = new CLI\CLI;
        $cli->addOption("r", "run", "action", "Run the specified task");
        $cli->addOption("s", "list", false, "List the available tasks");
        $opts = $cli->parse($_SERVER['argv']);

        if (isset($opts['help']))
            $cli->syntax("");

        $taskrunner = new Task\TaskRunner($this);
        if ($opts->has('list'))
        {
            $taskrunner->listTasks();
            exit();
        }

        if (!$opts->has('run'))
            $cli->syntax("Please specify the action to run");

        $taskrunner->run($opts->get('run'));
    }
Handle a CLI request: parse the command line options and send it off to the task runner