Change --output-format argument from optional to required
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Mon, 8 Aug 2016 17:27:27 +0000 (02:27 +0900)
committerJens Axboe <axboe@fb.com>
Mon, 8 Aug 2016 17:31:11 +0000 (11:31 -0600)
Not sure if there were any reason d10983d7 chose to add if(!optarg)
conditional, but this is what other fio options (or in general) do.

Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
init.c

diff --git a/init.c b/init.c
index 0a6766e39f1a082dc78a815b307d36d289684ae7..fb07daadbb7a6ee12118e99f4999e0b5017c0eb3 100644 (file)
--- a/init.c
+++ b/init.c
@@ -114,7 +114,7 @@ static struct option l_opts[FIO_NR_OPTIONS] = {
        },
        {
                .name           = (char *) "output-format",
-               .has_arg        = optional_argument,
+               .has_arg        = required_argument,
                .val            = 'F' | FIO_CLIENT_FLAG,
        },
        {
@@ -2352,12 +2352,6 @@ int parse_cmd_line(int argc, char *argv[], int client_type)
                        output_format = FIO_OUTPUT_TERSE;
                        break;
                case 'F':
-                       if (!optarg) {
-                               log_err("fio: missing --output-format argument\n");
-                               exit_val = 1;
-                               do_exit++;
-                               break;
-                       }
                        if (parse_output_format(optarg)) {
                                log_err("fio: failed parsing output-format\n");
                                exit_val = 1;