Skip to content

Commit

Permalink
Fix inspect command
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Sherman <[email protected]>
  • Loading branch information
bentsherman committed Sep 15, 2023
1 parent 78cd98b commit 5130c33
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 28 deletions.
26 changes: 13 additions & 13 deletions modules/nextflow/src/main/groovy/nextflow/cli/CmdInspect.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

}
Expand All @@ -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
Expand Down
10 changes: 2 additions & 8 deletions modules/nextflow/src/main/groovy/nextflow/cli/CmdRun.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@ class CmdRun {
String getLauncherCli()
CliOptions getLauncherOptions()

void setLauncherCli(String launcherCli)
void setLauncherOptions(CliOptions launcherOptions)
void setRunName(String runName)
}

Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

}
20 changes: 14 additions & 6 deletions modules/nextflow/src/main/groovy/nextflow/cli/v2/RunCmd.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> args) {
this.pipelineArgs = args
}

void setParams(Map<String,String> params) {
this.pipelineParams = params
}

@Override
Expand Down

0 comments on commit 5130c33

Please sign in to comment.