File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ Examples:
6
6
nipype_crash_search -d nipype/wd/log -r '.*subject123.*'
7
7
"""
8
8
import re
9
+ import sys
9
10
import os .path as op
10
11
from glob import glob
11
12
@@ -60,6 +61,7 @@ def display_crash_search(logdir, regex):
60
61
61
62
if __name__ == "__main__" :
62
63
from argparse import ArgumentParser , RawTextHelpFormatter
64
+
63
65
defstr = ' (default %(default)s)'
64
66
parser = ArgumentParser (prog = 'nipype_crash_search' ,
65
67
description = __doc__ ,
@@ -71,6 +73,10 @@ if __name__ == "__main__":
71
73
default = '*' ,
72
74
help = 'Regular expression to be searched in each traceback.' + defstr )
73
75
74
- args = parser .parse_args ()
76
+ if len (sys .argv ) == 1 :
77
+ parser .print_help ()
78
+ exit (0 )
75
79
80
+ args = parser .parse_args ()
76
81
display_crash_search (args .logdir , args .regex )
82
+ exit (0 )
You can’t perform that action at this time.
0 commit comments