Disentangle ListPlugins and PluginLsCommand

ListPlugins has a lot of code that is only used for printing the
output to stdout, which is only used by PluginLsCommand.

Simplify ListPlugins to only return the map of plugins, and move the
logic for displaying the output into PluginLsCommand.

PluginLsCommand does not have access to the Plugin objects, but only
to what is returned in PluginInfo instances. Extend that to include
the filename, which was previously accessible to ListPlugins.

This change removes support for the format option from the list
plugins REST API endpoint.

Change-Id: I0c352e587d5f0e8d524ae5b7322e1feec9434d58
This commit is contained in:
David Pursehouse
2017-08-04 21:03:28 +02:00
parent c1eb61280d
commit 4a64821338
6 changed files with 73 additions and 73 deletions

View File

@@ -18,12 +18,14 @@ public class PluginInfo {
public final String id;
public final String version;
public final String indexUrl;
public final String filename;
public final Boolean disabled;
public PluginInfo(String id, String version, String indexUrl, Boolean disabled) {
public PluginInfo(String id, String version, String indexUrl, String filename, Boolean disabled) {
this.id = id;
this.version = version;
this.indexUrl = indexUrl;
this.filename = filename;
this.disabled = disabled;
}
}