Skip to content

Commit 4db41bd

Browse files
committed
Added support for lists of files as command line inputs.
1 parent 1360492 commit 4db41bd

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

nipype/utils/nipype_cmd.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import argparse
33
import inspect
44
import sys
5-
from nipype.interfaces.base import Interface
5+
from nipype.interfaces.base import Interface, InputMultiPath
66
from nipype.utils.misc import str2bool
77

88
def listClasses(module=None):
@@ -23,11 +23,14 @@ def add_options(parser=None, module=None, function=None):
2323
inputs = interface.input_spec()
2424
for name, spec in sorted(interface.inputs.traits(transient=None).items()):
2525
desc = "\n".join(interface._get_trait_desc(inputs, name, spec))[len(name)+2:]
26+
args = {}
27+
if spec.is_trait_type(InputMultiPath):
28+
args["nargs"]="*"
2629
if hasattr(spec, "mandatory") and spec.mandatory:
27-
parser.add_argument(name, help=desc)
30+
parser.add_argument(name, help=desc, **args)
2831
else:
2932
parser.add_argument("--%s"%name, dest=name,
30-
help=desc)
33+
help=desc, **args)
3134
return parser, interface
3235

3336
def run_instance(interface, options):

0 commit comments

Comments
 (0)