protected Object doExecute() throws Exception {
if (!profileService.hasVersion(versionId)) {
System.out.println("Version " + versionId + " does not exists!");
return null;
}
Version version = profileService.getRequiredVersion(versionId);
String description = version.getAttributes().get(Version.DESCRIPTION);
String derivedFrom = null;
boolean defaultVersion = version.getId().equals(fabricService.getDefaultVersionId());
List<Profile> profiles = CommandUtils.sortProfiles(version.getProfiles());
List<Container> containerList = new ArrayList<Container>();
for (String c : dataStore.getContainers()) {
Container container = fabricService.getContainer(c);
if (version.getId().equals(container.getVersion().getId())) {
containerList.add(container);
}
}
Container[] containers = CommandUtils.sortContainers(containerList.toArray(new io.fabric8.api.Container[containerList.size()]));
System.out.println(String.format(FORMAT, "Name:", version.getId()));
System.out.println(String.format(FORMAT, "Description:", (description != null ? description : "")));
System.out.println(String.format(FORMAT, "Derived From:", (derivedFrom) != null ? derivedFrom : ""));
System.out.println(String.format(FORMAT, "Default Version:", defaultVersion));
if (containers.length == 0) {
System.out.println(String.format(FORMAT, "Containers:", ""));