Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/main/java/com/mindee/v2/cli/BaseInferenceCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ public abstract class BaseInferenceCommand implements Callable<Integer> {

/** Output format for the command. */
public enum OutputType {
Summary,
Full,
Raw
summary,
full,
raw
}

@Option(
Expand All @@ -41,7 +41,7 @@ public enum OutputType {
+ "- summary: a basic summary (default)\n"
+ "- full: detail extraction results, including options\n"
+ "- raw: full JSON object",
defaultValue = "Summary"
defaultValue = "summary"
)
protected OutputType output;

Expand Down Expand Up @@ -89,10 +89,10 @@ public Integer call() throws Exception {

private void printOutput(CommonResponse response) throws Exception {
switch (output) {
case Full:
case full:
System.out.println(getFullOutput(response));
break;
case Raw:
case raw:
var mapper = new ObjectMapper().enable(SerializationFeature.INDENT_OUTPUT);
var jsonNode = mapper.readTree(response.getRawResponse());
System.out.println(mapper.writeValueAsString(jsonNode));
Expand Down
Loading