1
Ich habe einen Befehl wie dieseseine von zwei Optionen
@CliCommand("show user")
public String showUser(
@CliOption(key = {"email"}) String email,
@CliOption(key = {"id"}) long id) {
//return user by id or by email
}
Ich möchte einer der beiden Option obligatorisch machen.
show user --id 5 //valid
show user --email [email protected] //valid
show user //not valid
show user id 5 --email [email protected] //not valid
Wie kann ich dieses Verhalten erreichen?
Ich hoffte, dass Spring Shell aus der Box-Lösung für dieses Problem zur Verfügung gestellt. –