Source:
private void updateTool(List<String> args) { if (args.isEmpty() || containsHelpRequest(args)) { updateToolHelp(); } else { final String toolpath = reqVal(args, "--entry"); try { DockstoreTool container = containersApi.getContainerByToolPath(toolpath); long containerId = container.getId(); final String cwlPath = optVal(args, "--cwl-path", container.getDefaultCwlPath()); final String wdlPath = optVal(args, "--wdl-path", container.getDefaultWdlPath()); final String dockerfilePath = optVal(args, "--dockerfile-path", container.getDefaultDockerfilePath()); final String toolname = optVal(args, "--toolname", container.getToolname()); final String gitUrl = optVal(args, "--git-url", container.getGitUrl()); final String defaultTag = optVal(args, "--default-version", container.getDefaultVersion()); container.setDefaultCwlPath(cwlPath); container.setDefaultWdlPath(wdlPath); container.setDefaultDockerfilePath(dockerfilePath); container.setToolname(toolname); container.setGitUrl(gitUrl); boolean updateVersionSuccess = false; for (Tag tag : container.getTags()) { if (tag.getName().equals(defaultTag)) { container.setDefaultVersion(defaultTag); updateVersionSuccess = true; break; } } if (!updateVersionSuccess && defaultTag != null) { out("Not a valid tag."); out("Valid tags include:"); for (Tag tag : container.getTags()) { out(tag.getReference()); } } containersApi.updateContainer(containerId, container); containersApi.refresh(containerId); out("The container has been updated."); } catch (ApiException ex) { exceptionMessage(ex, "", Client.API_ERROR); } } }

Target:
private void updateTool(List<String> args) { if (args.isEmpty() || containsHelpRequest(args)) { updateToolHelp(); } else { final String toolpath = reqVal(args, "--entry"); try { DockstoreTool container = containersApi.getContainerByToolPath(toolpath); long containerId = container.getId(); final String cwlPath = optVal(args, "--cwl-path", container.getDefaultCwlPath()); final String wdlPath = optVal(args, "--wdl-path", container.getDefaultWdlPath()); final String dockerfilePath = optVal(args, "--dockerfile-path", container.getDefaultDockerfilePath()); final String toolname = optVal(args, "--toolname", container.getToolname()); final String gitUrl = optVal(args, "--git-url", container.getGitUrl()); final String defaultTag = optVal(args, "--default-version", container.getDefaultVersion()); container.setDefaultCwlPath(cwlPath); container.setDefaultWdlPath(wdlPath); container.setDefaultDockerfilePath(dockerfilePath); container.setToolname(toolname); container.setGitUrl(gitUrl); boolean updateVersionSuccess = false; for (Tag tag : container.getTags()) { if (tag.getName().equals(defaultTag)) { container.setDefaultVersion(defaultTag); updateVersionSuccess = true; break; } } if (!updateVersionSuccess && defaultTag != null) { out("Not a valid version."); out("Valid versions include:"); for (Tag tag : container.getTags()) { out(tag.getReference()); } errorMessage("Please enter a valid version.", Client.CLIENT_ERROR); } containersApi.updateContainer(containerId, container); containersApi.refresh(containerId); out("The container has been updated."); } catch (ApiException ex) { exceptionMessage(ex, "", Client.API_ERROR); } } }