Show fio help page when no arguments are given
[fio.git] / init.c
diff --git a/init.c b/init.c
index 201a405b1aa8aef5ac8c16042065e0765b6df2aa..83957cfc10e09eb76e1206f6ba1d705b5a0e043a 100644 (file)
--- a/init.c
+++ b/init.c
@@ -17,7 +17,7 @@
 #include "fio.h"
 #include "parse.h"
 
-static char fio_version_string[] = "fio 1.17.1";
+static char fio_version_string[] = "fio 1.17.2";
 
 #define FIO_RANDSEED           (0xb1899bedUL)
 
@@ -751,9 +751,10 @@ static int setup_thread_area(void)
        return 0;
 }
 
-static void usage(void)
+static void usage(const char *name)
 {
        printf("%s\n", fio_version_string);
+       printf("%s [options] [job options] <job file(s)>\n", name);
        printf("\t--output\tWrite output to file\n");
        printf("\t--timeout\tRuntime in seconds\n");
        printf("\t--latency-log\tGenerate per-job latency logs\n");
@@ -795,7 +796,7 @@ static int parse_cmd_line(int argc, char *argv[])
                        terse_output = 1;
                        break;
                case 'h':
-                       usage();
+                       usage(argv[0]);
                        exit(0);
                case 'c':
                        exit(fio_show_option_help(optarg));
@@ -901,6 +902,7 @@ int parse_options(int argc, char *argv[])
                        return 0;
 
                log_err("No jobs defined(s)\n");
+               usage(argv[0]);
                return 1;
        }