limit results by default (ideally we'd have a --limit flag...)

This commit is contained in:
Shish 2019-10-04 21:02:16 +01:00
parent 32662af1ac
commit 134d2c029c

View File

@ -210,11 +210,8 @@ class Index extends Extension
print "\t\tsearch the database and print results\n\n";
}
if ($event->cmd == "search") {
if (count($event->args) < 1) {
return;
}
$query = count($event) > 0 ? Tag::explode($event->args[0]) : [];
$items = Image::find_images(0, null, $query);
$query = count($event->args) > 0 ? Tag::explode($event->args[0]) : [];
$items = Image::find_images(0, 100, $query);
foreach ($items as $item) {
print("{$item->hash}\n");
}