[PATCH] fio: Add version info print
authorJens Axboe <axboe@suse.de>
Wed, 7 Dec 2005 12:54:11 +0000 (13:54 +0100)
committerJens Axboe <axboe@suse.de>
Wed, 7 Dec 2005 12:54:11 +0000 (13:54 +0100)
README.fio
fio-ini.c

index f138fb1df159213fada25bfa7bb1975dc9cfd887..c93a22db057c36a81743dc763236ac3f4059763d 100644 (file)
@@ -19,6 +19,7 @@ $ fio
        -l Generate per-job latency logs
        -w Generate per-job bandwidth logs
        -f <file> Read <file> for job descriptions
+       -v Print version information and exit
 
 The <jobs> format is as follows:
 
index ab0c0d39324a35fca86fb4ae8fb941d72adc5c47..748a29cf948d7e8bdc314bebd622d1948d8bf14b 100644 (file)
--- a/fio-ini.c
+++ b/fio-ini.c
@@ -35,6 +35,8 @@
 #define DEF_USE_THREAD (0)
 #define DEF_FILE_SIZE  (1024 * 1024 * 1024UL)
 
+static char fio_version_string[] = "fio 1.0";
+
 static int repeatable = DEF_RAND_REPEAT;
 static char *ini_file;
 static int max_jobs = MAX_JOBS;
@@ -818,7 +820,7 @@ static void parse_cmd_line(int argc, char *argv[])
 {
        int c;
 
-       while ((c = getopt(argc, argv, "s:b:t:r:R:o:f:lw")) != EOF) {
+       while ((c = getopt(argc, argv, "s:b:t:r:R:o:f:lwv")) != EOF) {
                switch (c) {
                        case 's':
                                def_thread.sequential = !!atoi(optarg);
@@ -852,6 +854,9 @@ static void parse_cmd_line(int argc, char *argv[])
                        case 'w':
                                write_bw_log = 1;
                                break;
+                       case 'v':
+                               printf("%s\n", fio_version_string);
+                               exit(0);
                }
        }
 }