From 0c9baf913d6d251973798048d29c60507f486ee6 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Thu, 11 Jan 2007 15:59:26 +0100 Subject: [PATCH] [PATCH] Update irange documentation Also allow ':' as the range delimeter, and '/' as the direction delimeter. Signed-off-by: Jens Axboe --- HOWTO | 5 ++++- parse.c | 12 +++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/HOWTO b/HOWTO index f36fc46e..4370c9f3 100644 --- a/HOWTO +++ b/HOWTO @@ -179,7 +179,10 @@ siint SI integer. A whole number value, which may contain a postfix bool Boolean. Usually parsed as an integer, however only defined for true and false (1 and 0). irange Integer range with postfix. Allows value range to be given, such - as 1024-4096. Also see siint. + as 1024-4096. A colon may also be used as the seperator, eg + 1k:4k. If the option allows two sets of ranges, they can be + specified with a ',' or '/' delimiter: 1k-4k/8k-32k. Also see + siint. With the above in mind, here follows the complete list of fio job parameters. diff --git a/parse.c b/parse.c index 03856dc2..29e2ff1c 100644 --- a/parse.c +++ b/parse.c @@ -218,8 +218,11 @@ static int __handle_option(struct fio_option *o, const char *ptr, void *data, p1 = strchr(tmp, '-'); if (!p1) { - ret = 1; - break; + p1 = strchr(tmp, ':'); + if (!p1) { + ret = 1; + break; + } } p2 = p1 + 1; @@ -309,8 +312,11 @@ static int handle_option(struct fio_option *o, const char *ptr, void *data) * Do this before parsing the first round, to check if we should * copy set 1 options to set 2. */ - if (ptr) + if (ptr) { ptr2 = strchr(ptr, ','); + if (!ptr2) + ptr2 = strchr(ptr, ':'); + } /* * Don't return early if parsing the first option fails - if -- 2.25.1