1010 ExistingFilePath ,
1111 UnexistingFilePath ,
1212 RegularExpression ,
13- PythonModule ,)
13+ PythonModule ,
14+ check_not_none ,)
1415
1516
1617# declare the CLI group
@@ -20,8 +21,8 @@ def cli():
2021
2122
2223@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 ,
2526 help = 'Regular expression to be searched in each traceback.' )
2627def search (logdir , regex ):
2728 """Search for tracebacks content.
@@ -43,16 +44,16 @@ def search(logdir, regex):
4344
4445
4546@cli .command (context_settings = CONTEXT_SETTINGS )
46- @click .argument ('crashfile' , type = ExistingFilePath ,)
47+ @click .argument ('crashfile' , type = ExistingFilePath , callback = check_not_none )
4748@click .option ('-r' , '--rerun' , is_flag = True , flag_value = True ,
4849 help = 'Rerun crashed node.' )
4950@click .option ('-d' , '--debug' , is_flag = True , flag_value = True ,
5051 help = 'Enable Python debugger when re-executing.' )
5152@click .option ('-i' , '--ipydebug' , is_flag = True , flag_value = True ,
5253 help = 'Enable IPython debugger when re-executing.' )
53- @click .option ('--dir' , type = ExistingDirPath ,
54+ @click .option ('-w' , '- -dir' , type = ExistingDirPath ,
5455 help = 'Directory where to run the node in.' )
55- def crash (crashfile , rerun , debug , ipydebug , directory ):
56+ def crash (crashfile , rerun , debug , ipydebug , dir ):
5657 """Display Nipype crash files.
5758
5859 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):
7071 sys .excepthook = ultratb .FormattedTB (mode = 'Verbose' ,
7172 color_scheme = 'Linux' ,
7273 call_pdb = 1 )
73- display_crash_file (crashfile , rerun , debug , directory )
74+ display_crash_file (crashfile , rerun , debug , dir )
7475
7576
7677@cli .command (context_settings = CONTEXT_SETTINGS )
77- @click .argument ('pklz_file' , type = ExistingFilePath )
78+ @click .argument ('pklz_file' , type = ExistingFilePath , callback = check_not_none )
7879def show (pklz_file ):
7980 """Print the content of Nipype node .pklz file.
8081
@@ -89,7 +90,8 @@ def show(pklz_file):
8990
9091
9192@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 )
9395@click .argument ('interface' , type = str , required = False )
9496@click .option ('--list' , is_flag = True , flag_value = True ,
9597 help = 'List the available Interfaces inside the given module.' )
@@ -152,8 +154,10 @@ def convert():
152154@click .option ("-i" , "--interface" , type = str , required = True ,
153155 help = "Name of the Nipype interface to export." )
154156@click .option ("-m" , "--module" , type = PythonModule (), required = True ,
157+ callback = check_not_none ,
155158 help = "Module where the interface is defined." )
156159@click .option ("-o" , "--output" , type = UnexistingFilePath , required = True ,
160+ callback = check_not_none ,
157161 help = "JSON file name where the Boutiques descriptor will be written." )
158162@click .option ("-t" , "--ignored-template-inputs" , type = str , multiple = True ,
159163 help = "Interface inputs ignored in path template creations." )
0 commit comments