accept directory command line argument

then all CMDTEST_*.py files in the directory will be added
This commit is contained in:
Johan Holmberg 2016-01-06 20:33:08 +01:00
parent 633b184c6a
commit dad35dd311

View File

@ -687,7 +687,9 @@ def parse_options():
py_files = [] py_files = []
selected_methods = set() selected_methods = set()
for arg in options.arg: for arg in options.arg:
if re.match(r'CMDTEST_.*\.py$', arg): if os.path.isdir(arg):
py_files.extend(glob.glob('%s/CMDTEST_*.py' % arg))
elif re.match(r'CMDTEST_.*\.py$', os.path.basename(arg)):
py_files.append(arg) py_files.append(arg)
else: else:
selected_methods.add(arg) selected_methods.add(arg)