Add --parse-only command line option

Sometimes it's useful just being able to verify whether a job
config is valid or not, without actually starting any jobs.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/init.c b/init.c
index 32da42c..c722688 100644
--- a/init.c
+++ b/init.c
@@ -34,6 +34,7 @@
 static int max_jobs = FIO_MAX_JOBS;
 static int dump_cmdline;
 static int def_timeout;
+static int parse_only;
 
 static struct thread_data def_thread;
 struct thread_data *threads = NULL;
@@ -151,6 +152,11 @@
 		.val		= 'd' | FIO_CLIENT_FLAG,
 	},
 	{
+		.name		= (char *) "parse-only",
+		.has_arg	= no_argument,
+		.val		= 'P' | FIO_CLIENT_FLAG,
+	},
+	{
 		.name		= (char *) "section",
 		.has_arg	= required_argument,
 		.val		= 'x' | FIO_CLIENT_FLAG,
@@ -817,7 +823,7 @@
 	/*
 	 * if we are just dumping the output command line, don't add the job
 	 */
-	if (dump_cmdline) {
+	if (dump_cmdline || parse_only) {
 		put_job(td);
 		return 0;
 	}
@@ -1251,6 +1257,7 @@
 	printf("  --debug=options\tEnable debug logging. May be one/more of:\n"
 		"\t\t\tprocess,file,io,mem,blktrace,verify,random,parse,\n"
 		"\t\t\tdiskutil,job,mutex,profile,time,net\n");
+	printf("  --parse-only\t\tParse options only, don't start any IO\n");
 	printf("  --output\t\tWrite output to file\n");
 	printf("  --runtime\t\tRuntime in seconds\n");
 	printf("  --latency-log\t\tGenerate per-job latency logs\n");
@@ -1528,6 +1535,9 @@
 			if (set_debug(optarg))
 				do_exit++;
 			break;
+		case 'P':
+			parse_only = 1;
+			break;
 		case 'x': {
 			size_t new_size;
 
@@ -1738,7 +1748,7 @@
 	fio_options_free(&def_thread);
 
 	if (!thread_number) {
-		if (dump_cmdline)
+		if (dump_cmdline || parse_only)
 			return 0;
 		if (exec_profile)
 			return 0;