Skip to content

Commit 7a0dfd4

Browse files
pditommasoclaude
andcommitted
Rename module info subcommand to module inspect
Keep `info` as a backward-compatible alias. Adds a generic `getAliases()` hook on `CmdBase` so subcommands can declare extra names, and wires it through `CmdModule` so both the JCommander parser and the usage/help lookup recognize aliases. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
1 parent 61793bb commit 7a0dfd4

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

modules/nextflow/src/main/groovy/nextflow/cli/CmdBase.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ abstract class CmdBase implements Runnable {
3030

3131
abstract String getName()
3232

33+
List<String> getAliases() { Collections.emptyList() }
34+
3335
protected List<String> getUnknownOptions(){ return this.unknownOptions }
3436

3537
void setUnknownOptions(List<String> options){ this.unknownOptions = options }

modules/nextflow/src/main/groovy/nextflow/cli/CmdModule.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class CmdModule extends CmdBase implements UsageAware {
7070
// Register all subcommands
7171
commands.each { cmd ->
7272
cmd.launcher = this.launcher
73-
this.jCommander.addCommand(cmd.getName(), cmd, new String[0])
73+
this.jCommander.addCommand(cmd.getName(), cmd, cmd.getAliases() as String[])
7474
}
7575
}
7676
return jCommander
@@ -117,7 +117,7 @@ class CmdModule extends CmdBase implements UsageAware {
117117
}
118118

119119
private CmdBase findCmd(String name) {
120-
commands.find { it.name == name }
120+
commands.find { it.name == name || name in it.aliases }
121121
}
122122

123123
/**

modules/nextflow/src/main/groovy/nextflow/cli/module/CmdModuleInfo.groovy

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,12 @@ class CmdModuleInfo extends CmdBase {
8282

8383
@Override
8484
String getName() {
85-
return 'info'
85+
return 'inspect'
86+
}
87+
88+
@Override
89+
List<String> getAliases() {
90+
return List.of('info')
8691
}
8792

8893
@Override

0 commit comments

Comments
 (0)