From: Jens Axboe Date: Wed, 7 Dec 2005 12:54:11 +0000 (+0100) Subject: [PATCH] fio: Add version info print X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=19ec784771d707cde23b6f494b36cc84e673cf63;p=disktools.git [PATCH] fio: Add version info print --- diff --git a/README.fio b/README.fio index f138fb1..c93a22d 100644 --- a/README.fio +++ b/README.fio @@ -19,6 +19,7 @@ $ fio -l Generate per-job latency logs -w Generate per-job bandwidth logs -f Read for job descriptions + -v Print version information and exit The format is as follows: diff --git a/fio-ini.c b/fio-ini.c index ab0c0d3..748a29c 100644 --- 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); } } }