Closed
Description
Hi,
I'm using Spring boot 3.1.0 and Spring shell 3.1.0 with vscode.
I created the following command:
package com.tam.cli.components.cmd.sample;
import org.springframework.shell.command.annotation.Command;
import org.springframework.shell.command.annotation.Option;
@Command(group = "SAMPLE", command = "sample")
public class SampleCmd {
@Command(command = "kebab-format")
public void kebabFormat(
@Option(longNames = "my-value", shortNames = 'm', required = true) String myValue) {
System.out.println("myValue: ".concat(myValue));
}
}
Help command:
[anonymous]:> help --command sample kebab-format
NAME
sample kebab-format -
SYNOPSIS
sample kebab-format [--my-value String] --help
OPTIONS
--my-value or -m String
[Mandatory]
--help or -h
help for sample kebab-format
[Optional]
[anonymous]:>
When I run the command I always get this error:
Configuring the property spring.shell.option.naming.case-type=kebab also doesn't work.
If I change the longName value to "myValue" works but there is a comma at the end of string if I use " or ':
If I change the longName with another value different to name of input parameter does not work:
package com.tam.cli.components.cmd.sample;
import org.springframework.shell.command.annotation.Command;
import org.springframework.shell.command.annotation.Option;
@Command(group = "SAMPLE", command = "sample")
public class SampleCmd {
@Command(command = "kebab-format")
public void kebabFormat(
@Option(longNames = "nameDifferent", shortNames = 'm', required = true) String myValue) {
System.out.println("myValue: ".concat(myValue));
}
}