Getting rid of json task and adding props task
This commit is contained in:
parent
7806a44238
commit
7d4cc64e24
|
@ -699,12 +699,25 @@ task('help', function($args = array())
|
||||||
echo "\n";
|
echo "\n";
|
||||||
});
|
});
|
||||||
|
|
||||||
task('json', function()
|
task('props', function($args = [])
|
||||||
{
|
{
|
||||||
$json = array();
|
$filter = '';
|
||||||
foreach(get_tasks() as $task)
|
if(isset($args[0]))
|
||||||
$json[$task->getName()] = $task->getProps();
|
$filter = $args[0];
|
||||||
echo json_encode($json);
|
|
||||||
|
$props = props();
|
||||||
|
|
||||||
|
echo "\n";
|
||||||
|
echo "Available props:\n";
|
||||||
|
foreach($props as $k => $v)
|
||||||
|
{
|
||||||
|
if($filter && stripos($k, $filter) === false)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
echo "---------------------------------\n";
|
||||||
|
echo "$k : " . var_export($v, true) . "\n";
|
||||||
|
}
|
||||||
|
echo "\n";
|
||||||
});
|
});
|
||||||
|
|
||||||
} //namespace taskman
|
} //namespace taskman
|
||||||
|
|
Loading…
Reference in New Issue