mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 08:09:41 +00:00
backend: allow pluginctl to filter on -x/-X option
This commit is contained in:
parent
58c5185b51
commit
3eb14bf941
@ -282,14 +282,19 @@ if (isset($opts['h'])) {
|
||||
echo "$key\n";
|
||||
}
|
||||
}
|
||||
} elseif (isset($opts['X'])) {
|
||||
echo json_encode(plugins_xmlrpc_sync(), $jflags) . PHP_EOL;
|
||||
} elseif (isset($opts['x'])) {
|
||||
} elseif (isset($opts['X']) || isset($opts['x'])) {
|
||||
$payload = [];
|
||||
foreach (plugins_xmlrpc_sync() as $key => $data) {
|
||||
$payload[$key] = $data['description'] ?? '';
|
||||
if (!empty($args[0]) && strcasecmp($key, $args[0])) {
|
||||
continue;
|
||||
}
|
||||
$payload[$key] = isset($opts['x']) ? ($data['description'] ?? '') : $data;
|
||||
}
|
||||
if (!empty($payload)) {
|
||||
natcasesort($payload);
|
||||
} else {
|
||||
$payload = new ArrayObject();
|
||||
}
|
||||
natcasesort($payload);
|
||||
echo json_encode($payload, $jflags) . PHP_EOL;
|
||||
} elseif (empty($args[0])) {
|
||||
// no arguments, list plugins of selected type
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user