10
10
ExistingFilePath ,
11
11
UnexistingFilePath ,
12
12
RegularExpression ,
13
- PythonModule ,)
13
+ PythonModule ,
14
+ check_not_none ,)
14
15
15
16
16
17
# declare the CLI group
@@ -20,8 +21,8 @@ def cli():
20
21
21
22
22
23
@cli .command (context_settings = CONTEXT_SETTINGS )
23
- @click .argument ('logdir' , type = ExistingDirPath )
24
- @click .option ('-r' , '--regex' , type = RegularExpression (), default = '*' ,
24
+ @click .argument ('logdir' , type = ExistingDirPath , callback = check_not_none )
25
+ @click .option ('-r' , '--regex' , type = RegularExpression (), callback = check_not_none ,
25
26
help = 'Regular expression to be searched in each traceback.' )
26
27
def search (logdir , regex ):
27
28
"""Search for tracebacks content.
@@ -43,16 +44,16 @@ def search(logdir, regex):
43
44
44
45
45
46
@cli .command (context_settings = CONTEXT_SETTINGS )
46
- @click .argument ('crashfile' , type = ExistingFilePath ,)
47
+ @click .argument ('crashfile' , type = ExistingFilePath , callback = check_not_none )
47
48
@click .option ('-r' , '--rerun' , is_flag = True , flag_value = True ,
48
49
help = 'Rerun crashed node.' )
49
50
@click .option ('-d' , '--debug' , is_flag = True , flag_value = True ,
50
51
help = 'Enable Python debugger when re-executing.' )
51
52
@click .option ('-i' , '--ipydebug' , is_flag = True , flag_value = True ,
52
53
help = 'Enable IPython debugger when re-executing.' )
53
- @click .option ('--dir' , type = ExistingDirPath ,
54
+ @click .option ('-w' , '- -dir' , type = ExistingDirPath ,
54
55
help = 'Directory where to run the node in.' )
55
- def crash (crashfile , rerun , debug , ipydebug , directory ):
56
+ def crash (crashfile , rerun , debug , ipydebug , dir ):
56
57
"""Display Nipype crash files.
57
58
58
59
For certain crash files, one can rerun a failed node in a temp directory.
@@ -70,11 +71,11 @@ def crash(crashfile, rerun, debug, ipydebug, directory):
70
71
sys .excepthook = ultratb .FormattedTB (mode = 'Verbose' ,
71
72
color_scheme = 'Linux' ,
72
73
call_pdb = 1 )
73
- display_crash_file (crashfile , rerun , debug , directory )
74
+ display_crash_file (crashfile , rerun , debug , dir )
74
75
75
76
76
77
@cli .command (context_settings = CONTEXT_SETTINGS )
77
- @click .argument ('pklz_file' , type = ExistingFilePath )
78
+ @click .argument ('pklz_file' , type = ExistingFilePath , callback = check_not_none )
78
79
def show (pklz_file ):
79
80
"""Print the content of Nipype node .pklz file.
80
81
@@ -89,7 +90,8 @@ def show(pklz_file):
89
90
90
91
91
92
@cli .command (context_settings = UNKNOWN_OPTIONS )
92
- @click .argument ('module' , type = PythonModule (), required = False )
93
+ @click .argument ('module' , type = PythonModule (), required = False ,
94
+ callback = check_not_none )
93
95
@click .argument ('interface' , type = str , required = False )
94
96
@click .option ('--list' , is_flag = True , flag_value = True ,
95
97
help = 'List the available Interfaces inside the given module.' )
@@ -152,8 +154,10 @@ def convert():
152
154
@click .option ("-i" , "--interface" , type = str , required = True ,
153
155
help = "Name of the Nipype interface to export." )
154
156
@click .option ("-m" , "--module" , type = PythonModule (), required = True ,
157
+ callback = check_not_none ,
155
158
help = "Module where the interface is defined." )
156
159
@click .option ("-o" , "--output" , type = UnexistingFilePath , required = True ,
160
+ callback = check_not_none ,
157
161
help = "JSON file name where the Boutiques descriptor will be written." )
158
162
@click .option ("-t" , "--ignored-template-inputs" , type = str , multiple = True ,
159
163
help = "Interface inputs ignored in path template creations." )
0 commit comments