-
Notifications
You must be signed in to change notification settings - Fork 397
Open
Labels
status/need-triageTeam needs to triage and take a first lookTeam needs to triage and take a first look
Description
As it was mentioned in the comment here boolean option without value does not properly work with argument:
#1304 (comment)
Considering this configuration:
package org.springframework.shell.samples.helloworld.boot;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.shell.core.command.annotation.Argument;
import org.springframework.shell.core.command.annotation.Command;
import org.springframework.shell.core.command.annotation.Option;
@SpringBootApplication
public class SpringShellApplication {
public static void main(String[] args) {
SpringApplication.run(SpringShellApplication.class, args);
}
@Command(name = "rm")
public String rm(@Option(shortName = 'f', defaultValue = "false") boolean force, @Argument(index = 0) String name) {
return "Removed " + name + " force " + force;
}
}It does not work as shell:>rm --force filename
But it works as shell:>rm filename --force

ThomasVitale
Metadata
Metadata
Assignees
Labels
status/need-triageTeam needs to triage and take a first lookTeam needs to triage and take a first look