-
Notifications
You must be signed in to change notification settings - Fork 393
Closed
Labels
type/bugIs a bug reportIs a bug report
Milestone
Description
This is regression from 4.0.0-M1.
4.0.0-M1
Consider configuration for 4.0.0-M1:
@SpringBootApplication
@CommandScan
@Command
public class SpringShellApplication {
public static void main(String[] args) {
SpringApplication.run(SpringShellApplication.class, args);
}
@Command(command = "hello")
public void hello(@Option(longNames = "name") @OptionValues(provider = "helloNameCompletionProvider") String name) {
System.out.println("Hello " + name + "!");
}
@Bean
public CompletionProvider helloNameCompletionProvider() {
return completionContext -> Stream.of("Peter", "Paul", "Mary").map(CompletionProposal::new).toList();
}
}Steps to reproduce:
- Write
helloand press tab - List of options is displayed
- Select
--nameand press tab - List of completion proposals is displayed
4.0.0-RC1
Now have the same configuration for 4.0.0-RC1:
@SpringBootApplication
public class SpringShellApplication {
public static void main(String[] args) {
SpringApplication.run(SpringShellApplication.class, args);
}
@Command(name = "hello", completionProvider = "helloNameCompletionProvider")
public void sayHello(@Option(longName = "name") String name) {
System.out.println("Hello " + name + "!");
}
@Bean
public CompletionProvider helloNameCompletionProvider() {
return completionContext -> Stream.of("Peter", "Paul", "Mary").map(CompletionProposal::new).toList();
}
}Steps to reproduce:
- Write
helloand press tab - List of options should be displayed but command proposals are displayed instead
Steps to reproduce:
- Write
hello --nameand press tab - List of option proposals should be displayed but command proposals are displayed instead

Metadata
Metadata
Assignees
Labels
type/bugIs a bug reportIs a bug report