@@ -225,7 +225,6 @@ def convert(
225225 -------
226226 None.
227227 """
228-
229228 nxdl_root , nxdl_f_path = helpers .get_nxdl_root_and_path (nxdl )
230229
231230 data = transfer_data_into_template (
@@ -288,28 +287,32 @@ def main_cli():
288287 default = [],
289288 multiple = True ,
290289 help = (
291- "Deprecated: Please use the positional file arguments instead. "
292- "The path to the input data file to read. (Repeat for more than one file.)"
290+ "Deprecated: Please use the positional file arguments instead. The path to the "
291+ "input data file to read. Repeat for more than one file. default=[] This option "
292+ "is required if no '--params-file' is supplied."
293293 ),
294294)
295295@click .option (
296296 "--reader" ,
297297 default = "json_map" ,
298298 type = click .Choice (get_names_of_all_readers (), case_sensitive = False ),
299- help = 'The reader to use. default="example"' ,
299+ help = (
300+ "The reader to use. Examples are json_map or readers from a pynxtools plugin. "
301+ "default='json_map' This option is required if no '--params-file' is supplied."
302+ ),
300303)
301304@click .option (
302305 "--nxdl" ,
303306 default = None ,
304307 help = (
305- "The name of the NXDL file to use without extension. "
306- "This option is required if no '--params-file' is supplied."
308+ "The name of the NeXus application definition file to use without the extension "
309+ "nxdl.xml. This option is required if no '--params-file' is supplied."
307310 ),
308311)
309312@click .option (
310313 "--output" ,
311314 default = "output.nxs" ,
312- help = "The path to the output NeXus file to be generated." ,
315+ help = "The path to the output NeXus file to be generated. default='output.nxs' " ,
313316)
314317@click .option (
315318 "--params-file" ,
@@ -342,7 +345,9 @@ def main_cli():
342345@click .option (
343346 "-c" ,
344347 "--config" ,
348+ "config_file" ,
345349 type = click .Path (exists = True , dir_okay = False , file_okay = True , readable = True ),
350+ default = None ,
346351 help = "A json config file for the reader" ,
347352)
348353# pylint: disable=too-many-arguments
@@ -356,8 +361,9 @@ def convert_cli(
356361 ignore_undocumented : bool ,
357362 skip_verify : bool ,
358363 mapping : str ,
359- config : str ,
364+ config_file : str ,
360365 fail : bool ,
366+ ** kwargs ,
361367):
362368 """This command allows you to use the converter functionality of the dataconverter."""
363369 if params_file :
@@ -379,6 +385,10 @@ def convert_cli(
379385 if mapping :
380386 reader = "json_map"
381387 input_file = input_file + tuple ([mapping ])
388+ # needs own call
389+
390+ if config_file :
391+ kwargs ["config_file" ] = config_file
382392
383393 file_list = []
384394 for file in files :
@@ -402,9 +412,9 @@ def convert_cli(
402412 nxdl ,
403413 output ,
404414 skip_verify ,
405- config_file = config ,
406415 ignore_undocumented = ignore_undocumented ,
407416 fail = fail ,
417+ ** kwargs ,
408418 )
409419 except FileNotFoundError as exc :
410420 raise click .BadParameter (str (exc )) from exc
0 commit comments