From 2b5b090c167df2e668cb90eb7c52baa2fe1717a4 Mon Sep 17 00:00:00 2001
From: Danny Auble <da@schedmd.com>
Date: Fri, 30 Nov 2012 12:08:51 -0800
Subject: [PATCH] Make it aware with --launch-cmd and launch/slurm it is
 invalid

---
 src/srun/libsrun/opt.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/srun/libsrun/opt.c b/src/srun/libsrun/opt.c
index 312bf7439fd..60e811e80b5 100644
--- a/src/srun/libsrun/opt.c
+++ b/src/srun/libsrun/opt.c
@@ -248,6 +248,14 @@ int initialize_and_process_args(int argc, char *argv[])
 		_opt_list();
 
 	if (opt.launch_cmd) {
+		char *launch_type = slurm_get_launch_type();
+		if (!strcmp(launch_type, "launch/slurm")) {
+			error("--launch-cmd option is invalid with %s",
+			      launch_type);
+			xfree(launch_type);
+			exit(1);
+		}
+		xfree(launch_type);
 		launch_g_create_job_step(NULL, 0, NULL, NULL);
 		exit(0);
 	}
-- 
GitLab