@@ -367,22 +367,20 @@ def list(ctx, pipeline_dir, json):
367367 """
368368 mods = nf_core .modules .PipelineModules ()
369369 mods .modules_repo = ctx .obj ["modules_repo_obj" ]
370- print (mods .list_modules (pipeline_dir , json ))
370+ mods .pipeline_dir = pipeline_dir
371+ print (mods .list_modules (json ))
371372
372373
373374@modules .command (help_priority = 2 )
374375@click .pass_context
375376@click .argument ("pipeline_dir" , type = click .Path (exists = True ), required = True , metavar = "<pipeline directory>" )
376- @click .argument ( " tool" , type = str , required = False , metavar = "( <tool name>) " )
377+ @click .option ( "-t" , "-- tool" , type = str , metavar = "<tool> or <tool/subtool> " )
377378def install (ctx , pipeline_dir , tool ):
378379 """
379380 Add a DSL2 software wrapper module to a pipeline.
380381
381- Given a software name, finds the relevant files in nf-core/modules
382- and copies to the pipeline along with associated metadata.
383-
384- If <tool name> is not supplied on the command line, an interactive fuzzy-finder
385- tool is given with available nf-core module names.
382+ Finds the relevant files in nf-core/modules and copies to the pipeline,
383+ along with associated metadata.
386384 """
387385 try :
388386 mods = nf_core .modules .PipelineModules ()
@@ -418,7 +416,7 @@ def install(ctx, pipeline_dir, tool):
418416@modules .command (help_priority = 4 )
419417@click .pass_context
420418@click .argument ("pipeline_dir" , type = click .Path (exists = True ), required = True , metavar = "<pipeline directory>" )
421- @click .argument ( " tool" , type = str , required = True , metavar = "<tool name >" )
419+ @click .option ( "-t" , "-- tool" , type = str , metavar = "<tool> or <tool/subtool >" )
422420def remove (ctx , pipeline_dir , tool ):
423421 """
424422 Remove a software wrapper from a pipeline.
@@ -436,7 +434,7 @@ def remove(ctx, pipeline_dir, tool):
436434@modules .command ("create" , help_priority = 5 )
437435@click .pass_context
438436@click .argument ("directory" , type = click .Path (exists = True ), required = True , metavar = "<directory>" )
439- @click .argument ( " tool" , type = str , required = True , metavar = "<tool/subtool>" )
437+ @click .option ( "-t" , "-- tool" , type = str , metavar = "<tool> or <tool/subtool>" )
440438@click .option ("-a" , "--author" , type = str , metavar = "<author>" , help = "Module author's GitHub username" )
441439@click .option ("-l" , "--label" , type = str , metavar = "<process label>" , help = "Standard resource label for process" )
442440@click .option ("-m" , "--meta" , is_flag = True , default = False , help = "Use Groovy meta map for sample information" )
@@ -446,10 +444,6 @@ def create_module(ctx, directory, tool, author, label, meta, no_meta, force):
446444 """
447445 Create a new DSL2 module from the nf-core template.
448446
449- \b
450- Tool should be named just <tool> or <tool/subtool>
451- e.g fastqc or samtools/sort, respectively.
452-
453447 If <directory> is a pipeline, this function creates a file called
454448 'modules/local/tool_subtool.nf'
455449
@@ -476,23 +470,20 @@ def create_module(ctx, directory, tool, author, label, meta, no_meta, force):
476470
477471@modules .command ("create-test-yml" , help_priority = 6 )
478472@click .pass_context
479- @click .argument ( "module " , type = str , required = True , metavar = "<module name >" )
473+ @click .option ( "-t " , "--tool" , type = str , metavar = "<tool> or <tool/subtool >" )
480474@click .option ("-r" , "--run-tests" , is_flag = True , default = False , help = "Run the test workflows" )
481475@click .option ("-o" , "--output" , type = str , help = "Path for output YAML file" )
482476@click .option ("-f" , "--force" , is_flag = True , default = False , help = "Overwrite output YAML file if it already exists" )
483477@click .option ("-p" , "--no-prompts" , is_flag = True , default = False , help = "Use defaults without prompting" )
484- def create_test_yml (ctx , module , run_tests , output , force , no_prompts ):
478+ def create_test_yml (ctx , tool , run_tests , output , force , no_prompts ):
485479 """
486480 Auto-generate a test.yml file for a new module.
487481
488- Given the name of a new module, run the Nextflow test command and automatically generate
482+ Given the name of a module, runs the Nextflow test command and automatically generate
489483 the required `test.yml` file based on the output files.
490-
491- If not supplied on the command line, tool will prompt for name, command, tags etc with
492- sensible defaults.
493484 """
494485 try :
495- meta_builder = nf_core .modules .ModulesTestYmlBuilder (module , run_tests , output , force , no_prompts )
486+ meta_builder = nf_core .modules .ModulesTestYmlBuilder (tool , run_tests , output , force , no_prompts )
496487 meta_builder .run ()
497488 except UserWarning as e :
498489 log .critical (e )
0 commit comments