From: Tokunori Ikegami Date: Wed, 18 Dec 2024 16:11:10 +0000 (+0900) Subject: nvme: disable output-format option json value without json-c X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=c7aeb90301fe1ad473bd7aa833a62edf0df89a60;p=users%2Fsagi%2Fnvme-cli.git 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 --- diff --git a/nvme.c b/nvme.c index 0c6dac30..e10653ac 100644 --- a/nvme.c +++ b/nvme.c @@ -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"; @@ -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