Skip to content

Commit 5c1ab09

Browse files
committed
Report invalid output format for 'list' command
Don't fail silently if user provdies invalid 'list' options. Reported-by: Christoph Hellwig <[email protected]> Signed-off-by: Keith Busch <[email protected]>
1 parent 9cae1ba commit 5c1ab09

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

nvme.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1399,8 +1399,10 @@ static int list(int argc, char **argv, struct command *cmd, struct plugin *plugi
13991399
return ret;
14001400

14011401
fmt = validate_output_format(cfg.output_format);
1402-
if (fmt != JSON && fmt != NORMAL)
1402+
if (fmt != JSON && fmt != NORMAL) {
1403+
fprintf(stderr, "Invalid output format\n");
14031404
return -EINVAL;
1405+
}
14041406

14051407
ret = scan_subsystems(&t);
14061408
if (ret) {

0 commit comments

Comments
 (0)