if (jobs.size() == 0) {
out.printf("Unknown job: %s%n", jobId);
return 1;
}
final Job job = Iterables.getOnlyElement(jobs.values());
if (json) {
out.println(Json.asPrettyStringUnchecked(job));
} else {
out.printf("Id: %s%n", job.getId());
out.printf("Image: %s%n", job.getImage());
out.printf("Command: %s%n", quote(job.getCommand()));
printMap(out, "Env: ", QUOTE, job.getEnv());
printMap(out, "Ports: ", FORMAT_PORTMAPPING, job.getPorts());
printMap(out, "Reg: ", FORMAT_SERVICE_PORTS, job.getRegistration());
out.printf("Grace period (seconds): %s%n", job.getGracePeriod());
printVolumes(out, job.getVolumes());
}
return 0;
}