-
Notifications
You must be signed in to change notification settings - Fork 393
Open
Labels
type/enhancementIs an enhancement requestIs an enhancement request
Milestone
Description
This seems like regression from some of the latests commits.
Consider this configuration:
@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", shortName = 'n') String name) {
System.out.println("Hello " + name + "!");
}
@Bean
public CompletionProvider helloNameCompletionProvider() {
return completionContext -> Stream.of("Peter", "Paul", "Mary").map(CompletionProposal::new).toList();
}
}There are some issues:
-
If a command is invoked without any option, the warning is logged. Which is not consistent if command is invoked with and option without value (there is no warning message).
shell:>hello 11:32:19.249 [main] WARN o.s.s.c.c.a.MethodInvokerCommandAdapter - No value provided for optional option '--name' and no default value specified. Hello ! shell:>hello --name Hello ! shell:>hello -n Hello ! -
If option is specified with a short or long name with space before the value, it's not recognized.
shell:>hello --name Paul Hello ! shell:>hello -n Paul Hello ! -
The value is recognized only if specified with equal sign.
shell:>hello --name=Paul Hello Paul! shell:>hello -n=Paul Hello Paul!

Metadata
Metadata
Assignees
Labels
type/enhancementIs an enhancement requestIs an enhancement request