From 5130c33ea553aa09a27576b6513a5fcf2a2a4cc3 Mon Sep 17 00:00:00 2001 From: Ben Sherman Date: Thu, 14 Sep 2023 20:50:49 -0500 Subject: [PATCH] Fix inspect command Signed-off-by: Ben Sherman --- .../groovy/nextflow/cli/CmdInspect.groovy | 26 +++++++++---------- .../main/groovy/nextflow/cli/CmdRun.groovy | 10 ++----- .../groovy/nextflow/cli/v2/InspectCmd.groovy | 14 +++++++++- .../main/groovy/nextflow/cli/v2/RunCmd.groovy | 20 +++++++++----- 4 files changed, 42 insertions(+), 28 deletions(-) diff --git a/modules/nextflow/src/main/groovy/nextflow/cli/CmdInspect.groovy b/modules/nextflow/src/main/groovy/nextflow/cli/CmdInspect.groovy index 6e113e3917..722a8d6512 100644 --- a/modules/nextflow/src/main/groovy/nextflow/cli/CmdInspect.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/cli/CmdInspect.groovy @@ -108,7 +108,18 @@ class CmdInspect { @Override void run() { - new CmdInspect(this).run() + final opts = new CmdRun.V1() + opts.launcher = launcher + opts.ansiLog = false + opts.preview = true + opts.args = args + opts.params = params + opts.paramsFile = paramsFile + opts.profile = profile + opts.revision = revision + opts.runConfig = runConfig + + new CmdInspect(this).run(opts) } } @@ -123,21 +134,10 @@ class CmdInspect { /* For testing purposes only */ CmdInspect() {} - void run() { + void run(CmdRun.Options opts) { // configure quiet mode LoggerHelper.setQuiet(true) // setup the target run command - final opts = new CmdRun.V1() - opts.launcherCli = this.launcherCli - opts.launcherOptions = this.launcherOptions - opts.args = this.args - opts.profile = this.profile - opts.revision = this.revision - opts.runConfig = this.runConfig - opts.params = this.params - opts.paramsFile = this.paramsFile - opts.preview = true - opts.ansiLog = false final target = new CmdRun(opts) target.previewAction = this.&applyInspect // run it diff --git a/modules/nextflow/src/main/groovy/nextflow/cli/CmdRun.groovy b/modules/nextflow/src/main/groovy/nextflow/cli/CmdRun.groovy index 0532715932..8f09bca060 100644 --- a/modules/nextflow/src/main/groovy/nextflow/cli/CmdRun.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/cli/CmdRun.groovy @@ -119,8 +119,6 @@ class CmdRun { String getLauncherCli() CliOptions getLauncherOptions() - void setLauncherCli(String launcherCli) - void setLauncherOptions(CliOptions launcherOptions) void setRunName(String runName) } @@ -344,18 +342,14 @@ class CmdRun { args.size() > 1 ? args[1..-1] : [] } - String launcherCli - - CliOptions launcherOptions - @Override String getLauncherCli() { - launcherCli ?: launcher.cliString + launcher.cliString } @Override CliOptions getLauncherOptions() { - launcherOptions ?: launcher.options + launcher.options } @Override diff --git a/modules/nextflow/src/main/groovy/nextflow/cli/v2/InspectCmd.groovy b/modules/nextflow/src/main/groovy/nextflow/cli/v2/InspectCmd.groovy index 6b6e2bf49c..fa3e94972f 100644 --- a/modules/nextflow/src/main/groovy/nextflow/cli/v2/InspectCmd.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/cli/v2/InspectCmd.groovy @@ -110,7 +110,19 @@ class InspectCmd extends AbstractCmd implements CmdInspect.Options { @Override void run() { - new CmdInspect(this).run() + final opts = new RunCmd() + opts.launcher = launcher + opts.ansiLog = false + opts.preview = true + opts.pipeline = pipeline + opts.args = args + opts.params = params + opts.paramsFile = paramsFile + opts.profile = profile + opts.revision = revision + opts.runConfig = runConfig + + new CmdInspect(this).run(opts) } } diff --git a/modules/nextflow/src/main/groovy/nextflow/cli/v2/RunCmd.groovy b/modules/nextflow/src/main/groovy/nextflow/cli/v2/RunCmd.groovy index 3abcd9852b..49bb3a1057 100644 --- a/modules/nextflow/src/main/groovy/nextflow/cli/v2/RunCmd.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/cli/v2/RunCmd.groovy @@ -257,18 +257,26 @@ class RunCmd extends AbstractCmd implements CmdRun.Options, HubOptionsV2 { return pipelineParams } - String launcherCli - - CliOptions launcherOptions - @Override String getLauncherCli() { - launcherCli ?: launcher.cliString + launcher.cliString } @Override CliOptions getLauncherOptions() { - launcherOptions ?: launcher.options + launcher.options + } + + void setLauncher(Launcher launcher) { + this.launcher = launcher + } + + void setArgs(List args) { + this.pipelineArgs = args + } + + void setParams(Map params) { + this.pipelineParams = params } @Override