Skip to content

Commit c7aeb90

Browse files
ikegami-tigaw
authored andcommitted
nvme: disable output-format option json value without json-c
Since only json print codes work with the json-c library. Signed-off-by: Tokunori Ikegami <[email protected]>
1 parent 144c5d6 commit c7aeb90

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

nvme.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,11 @@ static struct program nvme = {
185185
.extensions = &builtin,
186186
};
187187

188+
#ifdef CONFIG_JSONC
188189
const char *output_format = "Output format: normal|json|binary";
190+
#else /* CONFIG_JSONC */
191+
const char *output_format = "Output format: normal|binary";
192+
#endif /* CONFIG_JSONC */
189193
const char *timeout = "timeout value, in milliseconds";
190194
const char *verbose = "Increase output verbosity";
191195

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

481485
if (!strcmp(format, "normal"))
482486
f = NORMAL;
487+
#ifdef CONFIG_JSONC
483488
else if (!strcmp(format, "json"))
484489
f = JSON;
490+
#endif /* CONFIG_JSONC */
485491
else if (!strcmp(format, "binary"))
486492
f = BINARY;
487493
else

0 commit comments

Comments
 (0)