Skip to content

Commit

Permalink
[#969] Reorganized code a little bit to facilitate (hopefully) comple…
Browse files Browse the repository at this point in the history
…tion support for nested sub-subcommands; simplify code
  • Loading branch information
remkop committed Mar 21, 2020
1 parent ca65357 commit 953d52c
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,10 @@ public SystemCompleter compileCompleters() {

private SystemCompleter compileCompleters(SystemCompleter completer, CommandLine cmd) {
completer.addAliases(extractAliases(cmd));
for (String name : cmd.getCommandSpec().subcommands().keySet()) {
CommandSpec sub = cmd.getSubcommands().get(name).getCommandSpec();
registerCompleters(completer, name, sub);

for (Map.Entry<String, CommandLine> entry : cmd.getSubcommands().entrySet()) {
CommandSpec sub = entry.getValue().getCommandSpec();
registerCompleters(completer, entry.getKey(), sub);

// TODO support nested sub-subcommands (https://github.com/remkop/picocli/issues/969)
// Is the below sufficient?
Expand Down

0 comments on commit 953d52c

Please sign in to comment.