Skip to content

Commit 943fcad

Browse files
committed
fix nipype_crash_search to print usage on no args
1 parent da1f544 commit 943fcad

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

bin/nipype_crash_search

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Examples:
66
nipype_crash_search -d nipype/wd/log -r '.*subject123.*'
77
"""
88
import re
9+
import sys
910
import os.path as op
1011
from glob import glob
1112

@@ -60,6 +61,7 @@ def display_crash_search(logdir, regex):
6061

6162
if __name__ == "__main__":
6263
from argparse import ArgumentParser, RawTextHelpFormatter
64+
6365
defstr = ' (default %(default)s)'
6466
parser = ArgumentParser(prog='nipype_crash_search',
6567
description=__doc__,
@@ -71,6 +73,10 @@ if __name__ == "__main__":
7173
default='*',
7274
help='Regular expression to be searched in each traceback.' + defstr)
7375

74-
args = parser.parse_args()
76+
if len(sys.argv) == 1:
77+
parser.print_help()
78+
exit(0)
7579

80+
args = parser.parse_args()
7681
display_crash_search(args.logdir, args.regex)
82+
exit(0)

0 commit comments

Comments
 (0)