Skip to content

Commit 1b92a10

Browse files
remkopMarkoMackic
authored andcommitted
1 parent 4b9521f commit 1b92a10

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/java/picocli/CommandLine.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6132,8 +6132,8 @@ public CommandSpec addSubcommand(String name, CommandLine subCommandLine) {
61326132
for (ArgSpec arg : args()) {
61336133
if (arg.scopeType() == ScopeType.INHERIT) {
61346134
subSpec.add(arg.isOption()
6135-
? OptionSpec.builder((OptionSpec) arg).inherited(true).root(arg.root()).build()
6136-
: PositionalParamSpec.builder((PositionalParamSpec) arg).inherited(true).root(arg.root()).build());
6135+
? OptionSpec.builder((OptionSpec) arg).inherited(true).build()
6136+
: PositionalParamSpec.builder((PositionalParamSpec) arg).inherited(true).build());
61376137
}
61386138
}
61396139
return this;
@@ -6260,7 +6260,7 @@ public CommandSpec addOption(OptionSpec option) {
62606260
Set<CommandLine> done = new HashSet<CommandLine>();
62616261
for (CommandLine sub : subcommands().values()) {
62626262
if (!done.contains(sub)) {
6263-
sub.getCommandSpec().addOption(OptionSpec.builder(option).inherited(true).root(option.root()).build());
6263+
sub.getCommandSpec().addOption(OptionSpec.builder(option).inherited(true).build());
62646264
done.add(sub);
62656265
}
62666266
}
@@ -6320,7 +6320,7 @@ public CommandSpec addPositional(PositionalParamSpec positional) {
63206320
if (positional.scopeType() == ScopeType.INHERIT) {
63216321
Set<CommandLine> subCmds = new HashSet<CommandLine>(subcommands().values());// subcommands may be registered multiple times with different aliases
63226322
for (CommandLine sub : subCmds) {
6323-
sub.getCommandSpec().addPositional(PositionalParamSpec.builder(positional).inherited(true).root(positional.root()).build());
6323+
sub.getCommandSpec().addPositional(PositionalParamSpec.builder(positional).inherited(true).build());
63246324
}
63256325
}
63266326
return this;

0 commit comments

Comments
 (0)