Skip to content
This repository was archived by the owner on Sep 12, 2024. It is now read-only.

Commit dd3ed07

Browse files
committed
Merge pull request #71 from spotify/rculbertson/inspect-typo
Make service registration format from inspect consistent with create
2 parents c7898e2 + 862f614 commit dd3ed07

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

helios-tools/src/main/java/com/spotify/helios/cli/command/JobInspectCommand.java

+4-5
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,15 @@ protected int runWithJobId(final Namespace options, final HeliosClient client,
103103
out.printf("Id: %s%n", job.getId());
104104
out.printf("Image: %s%n", job.getImage());
105105
out.printf("Command: %s%n", quote(job.getCommand()));
106-
printMap(out, "Env: ", "%s=%s", QUOTE, job.getEnv());
107-
printMap(out, "Ports: ", "%s=%s", FORMAT_PORTMAPPING, job.getPorts());
108-
printMap(out, "Reg: ", "%s: %s", FORMAT_SERVICE_PORTS, job.getRegistration());
106+
printMap(out, "Env: ", QUOTE, job.getEnv());
107+
printMap(out, "Ports: ", FORMAT_PORTMAPPING, job.getPorts());
108+
printMap(out, "Reg: ", FORMAT_SERVICE_PORTS, job.getRegistration());
109109
}
110110

111111
return 0;
112112
}
113113

114114
private <K extends Comparable<K>, V> void printMap(final PrintStream out, final String name,
115-
final String format,
116115
final Function<V, String> transform,
117116
final Map<K, V> values) {
118117
out.print(name);
@@ -122,7 +121,7 @@ private <K extends Comparable<K>, V> void printMap(final PrintStream out, final
122121
out.print(Strings.repeat(" ", name.length()));
123122
}
124123
final V value = values.get(key);
125-
out.printf(format + "%n", key, transform.apply(value));
124+
out.printf("%s=%s%n", key, transform.apply(value));
126125
first = false;
127126
}
128127
if (first) {

0 commit comments

Comments
 (0)