Compare commits

...

2 Commits

Author SHA1 Message Date
Pavel Shevaev e68ad37770 Fixing main
Publish PHP Package / docker (push) Successful in 6s Details
2025-03-24 09:53:07 +03:00
Pavel Shevaev 8dc71ab534 Fixing disabled built-in tasks; Improving missing task error reporting
Publish PHP Package / docker (push) Successful in 6s Details
2025-03-24 09:50:17 +03:00
2 changed files with 11 additions and 13 deletions

View File

@ -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");
}
}

View File

@ -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)