Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support arg=value format with options #979

Open
Martiul opened this issue Jan 18, 2024 · 2 comments
Open

Support arg=value format with options #979

Martiul opened this issue Jan 18, 2024 · 2 comments
Labels
type/enhancement Is an enhancement request
Milestone

Comments

@Martiul
Copy link

Martiul commented Jan 18, 2024

Hello,

I recently upgraded from spring-shell 2.7.5 to 3.2.0, and found that arguments of the form "arg=value" are no longer accepted.

Is this a regression, or was it intended?

Sample code:

  @ShellMethod(
      value = "Description",
      key = {"test"})
  public void test(
      @ShellOption(
          value = {"--foo", "-f"},
          defaultValue = ShellOption.NULL) String foo) {
    System.out.println("Foo is: " + foo);
  }

shell:> test --foo=bar

Expected:

Foo is: bar

Actual:

Unrecognised option '--foo=bar'
@github-actions github-actions bot added the status/need-triage Team needs to triage and take a first look label Jan 18, 2024
@jvalkeal
Copy link
Contributor

Thanks for pointing this out. It wasn't implemented when parser infra went through complete overhaul.

I'm just thinking that when we add support for this should we be explicit which formats are supported, --arg value vs. --arg=value. It might be convenient to allow user to choose either or both.

@Martiul
Copy link
Author

Martiul commented Jan 19, 2024

Thanks for the response @jvalkeal . For me specially, this is not a blocking/urgent bug, but figured it was worth mentioning in case other users do the same migration

@jvalkeal jvalkeal changed the title Parameter arg=value format no longer works. "Unrecognised option" error Support arg=value format with options Jan 20, 2024
@jvalkeal jvalkeal added type/enhancement Is an enhancement request and removed status/need-triage Team needs to triage and take a first look labels Jan 20, 2024
@jvalkeal jvalkeal added this to the 3.2.x milestone Jan 20, 2024
@jvalkeal jvalkeal modified the milestones: 3.2.x, 3.3.x Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement Is an enhancement request
Projects
None yet
Development

No branches or pull requests

2 participants