Accept -foo as well as --foo for options
[fio.git] / init.c
diff --git a/init.c b/init.c
index c6837c9f91d3bea0db10d7a8a4a106bcf9268deb..2259edf5afee0b3396b89f245ae0c1223afe0726 100644 (file)
--- a/init.c
+++ b/init.c
@@ -581,7 +581,7 @@ static struct option long_options[FIO_JOB_OPTS + FIO_CMD_OPTS] = {
        },
        {
                .name           = "cmdhelp",
-               .has_arg        = required_argument,
+               .has_arg        = optional_argument,
                .val            = 'c',
        },
        {
@@ -1223,7 +1223,7 @@ static int parse_cmd_line(int argc, char *argv[])
        struct thread_data *td = NULL;
        int c, ini_idx = 0, lidx, ret, dont_add_job = 0;
 
-       while ((c = getopt_long(argc, argv, "", long_options, &lidx)) != -1) {
+       while ((c = getopt_long_only(argc, argv, "", long_options, &lidx)) != -1) {
                switch (c) {
                case 't':
                        def_timeout = atoi(optarg);