Compare commits
2 Commits
Author | SHA1 | Date |
---|---|---|
|
e68ad37770 | |
|
8dc71ab534 |
|
@ -2,11 +2,6 @@
|
|||
namespace taskman;
|
||||
use Exception;
|
||||
|
||||
include_once(__DIR__ . '/internal.inc.php');
|
||||
include_once(__DIR__ . '/util.inc.php');
|
||||
include_once(__DIR__ . '/tasks.inc.php');
|
||||
include_once(__DIR__ . '/artefact.inc.php');
|
||||
|
||||
$GLOBALS['TASKMAN_TASKS'] = array();
|
||||
$GLOBALS['TASKMAN_CLOSURES'] = array();
|
||||
$GLOBALS['TASKMAN_STACK'] = array();
|
||||
|
@ -21,6 +16,11 @@ $GLOBALS['TASKMAN_ERROR_HANDLER'] = null;
|
|||
$GLOBALS['TASKMAN_START_TIME'] = 0;
|
||||
$GLOBALS['TASKMAN_FILES_CHANGES'] = null;
|
||||
|
||||
include_once(__DIR__ . '/internal.inc.php');
|
||||
include_once(__DIR__ . '/util.inc.php');
|
||||
include_once(__DIR__ . '/tasks.inc.php');
|
||||
include_once(__DIR__ . '/artefact.inc.php');
|
||||
|
||||
class TaskmanException extends Exception
|
||||
{}
|
||||
|
||||
|
@ -474,14 +474,11 @@ function main(
|
|||
$tasks = $hints;
|
||||
else
|
||||
{
|
||||
printf("ERROR! Task %s not found\n", $tasks[0]);
|
||||
$similars = '';
|
||||
if($hints)
|
||||
{
|
||||
printf("Similar tasks:\n");
|
||||
foreach($hints as $hint)
|
||||
printf(" %s\n", $hint);
|
||||
}
|
||||
exit(1);
|
||||
$similars .= "\nSimilar tasks: " . implode(', ', $hints) . ".";
|
||||
|
||||
throw new Exception("Task '{$tasks[0]}' not found. $similars");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,8 @@ task('help', function($args = array())
|
|||
$all = get_tasks();
|
||||
foreach($all as $task)
|
||||
{
|
||||
if($filter && (strpos($task->getName(), $filter) === false && strpos($task->getPropOr("alias", ""), $filter) === false))
|
||||
if($filter && (strpos($task->getName(), $filter) === false &&
|
||||
strpos($task->getPropOr("alias", ""), $filter) === false))
|
||||
continue;
|
||||
|
||||
if(strlen($task->getName()) > $maxlen)
|
||||
|
|
Loading…
Reference in New Issue