From fac476102eea90ee2bf6621abe049d4cfc8d84f8 Mon Sep 17 00:00:00 2001
From: Michiel Cottaar <MichielCottaar@protonmail.com>
Date: Thu, 19 Sep 2019 13:56:10 +0100
Subject: [PATCH] BUG: use _prepareArgs to unpack input arguments

---
 fsl/utils/fslsub.py | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/fsl/utils/fslsub.py b/fsl/utils/fslsub.py
index 713826a8c..81a1fc942 100644
--- a/fsl/utils/fslsub.py
+++ b/fsl/utils/fslsub.py
@@ -55,7 +55,7 @@ import importlib
 log = logging.getLogger(__name__)
 
 
-def submit(command,
+def submit(*command,
            minutes=None,
            queue=None,
            architecture=None,
@@ -70,9 +70,12 @@ def submit(command,
            flags=False,
            multi_threaded=None,
            verbose=False):
-    """Submits a given command to the cluster
+    """
+    Submits a given command to the cluster
+
+    You can pass the command and arguments as a single string, or as a regular or unpacked sequence.
 
-    :arg command:        single string with the job command
+    :arg command:        string or regular/unpacked sequence of strings with the job command
     :arg minutes:        Estimated job length in minutes, used to auto-set
                          queue name
     :arg queue:          Explicitly sets the queue name
@@ -101,7 +104,7 @@ def submit(command,
     :return:             string of submitted job id
     """
 
-    from fsl.utils.run import runfsl
+    from fsl.utils.run import runfsl, _prepareArgs
 
     base_cmd = ['fsl_sub']
 
@@ -132,7 +135,7 @@ def submit(command,
         base_cmd.append('-s')
         base_cmd.extend(multi_threaded)
 
-    base_cmd.append(command)
+    base_cmd.extend(_prepareArgs(command))
 
     return runfsl(*base_cmd).strip()
 
-- 
GitLab