Skip to content

Commit

Permalink
nvme: disable output-format option json value without json-c
Browse files Browse the repository at this point in the history
Since only json print codes work with the json-c library.

Signed-off-by: Tokunori Ikegami <[email protected]>
  • Loading branch information
ikegami-t authored and igaw committed Dec 18, 2024
1 parent 144c5d6 commit c7aeb90
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions nvme.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,11 @@ static struct program nvme = {
.extensions = &builtin,
};

#ifdef CONFIG_JSONC
const char *output_format = "Output format: normal|json|binary";
#else /* CONFIG_JSONC */
const char *output_format = "Output format: normal|binary";
#endif /* CONFIG_JSONC */
const char *timeout = "timeout value, in milliseconds";
const char *verbose = "Increase output verbosity";

Expand Down Expand Up @@ -480,8 +484,10 @@ int validate_output_format(const char *format, nvme_print_flags_t *flags)

if (!strcmp(format, "normal"))
f = NORMAL;
#ifdef CONFIG_JSONC
else if (!strcmp(format, "json"))
f = JSON;
#endif /* CONFIG_JSONC */
else if (!strcmp(format, "binary"))
f = BINARY;
else
Expand Down

0 comments on commit c7aeb90

Please sign in to comment.