[PATCH] Allow job file to be last argument
authorJens Axboe <axboe@suse.de>
Sat, 27 May 2006 15:26:50 +0000 (17:26 +0200)
committerJens Axboe <axboe@suse.de>
Sat, 27 May 2006 15:26:50 +0000 (17:26 +0200)
Use fio -f <jobfile> or just fio <jobfile>

fio-ini.c

index 126e325..23810ba 100644 (file)
--- a/fio-ini.c
+++ b/fio-ini.c
@@ -969,6 +969,9 @@ static void parse_cmd_line(int argc, char *argv[])
                                exit(0);
                }
        }
+
+       if (!ini_file && argc > 1 && argv[argc - 1][0] != '-')
+               ini_file = strdup(argv[argc - 1]);
 }
 
 static void free_shm(void)
@@ -1030,8 +1033,10 @@ int parse_options(int argc, char *argv[])
                return 1;
        }
 
-       if (parse_jobs_ini(ini_file))
+       if (parse_jobs_ini(ini_file)) {
+               usage(argv[0]);
                return 1;
+       }
 
        return 0;
 }