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

Positional args mapped differently vs given option #622

Closed
jvalkeal opened this issue Jan 15, 2023 · 0 comments
Closed

Positional args mapped differently vs given option #622

jvalkeal opened this issue Jan 15, 2023 · 0 comments
Assignees
Labels
branch/2.1.x Issue for a branch for/backport For backporting type/bug Is a bug report
Milestone

Comments

@jvalkeal
Copy link
Contributor

Regression from previous work #614 and #616.

Shown as where last command doesn't work anymore:

my-shell:>help --command e2e reg default-value
NAME
       e2e reg default-value - 

SYNOPSIS
       e2e reg default-value --arg1 String --help 

OPTIONS
       --arg1 String
       [Optional, default = hi]

       --help or -h 
       help for e2e reg default-value
       [Optional]



my-shell:>help --command "e2e reg default-value"
NAME
       e2e reg default-value - 

SYNOPSIS
       e2e reg default-value --arg1 String --help 

OPTIONS
       --arg1 String
       [Optional, default = hi]

       --help or -h 
       help for e2e reg default-value
       [Optional]



my-shell:>help "e2e reg default-value"
NAME
       e2e reg default-value - 

SYNOPSIS
       e2e reg default-value --arg1 String --help 

OPTIONS
       --arg1 String
       [Optional, default = hi]

       --help or -h 
       help for e2e reg default-value
       [Optional]



my-shell:>help e2e reg default-value
Unknown command 'e2e,reg,default-value'
Details of the error have been omitted. You can use the stacktrace command to print the full stacktrace.

@jvalkeal jvalkeal added the type/bug Is a bug report label Jan 15, 2023
@jvalkeal jvalkeal added this to the 3.0.0 milestone Jan 15, 2023
@jvalkeal jvalkeal self-assigned this Jan 15, 2023
@jvalkeal jvalkeal added for/backport For backporting branch/2.1.x Issue for a branch labels Jan 16, 2023
jvalkeal added a commit that referenced this issue Jan 16, 2023
- Issue in #622 is that its command type is `String` and internally
  some incoming arguments(it's List) were converted to String by
  joining with space. This caused one case with help command to get
  conversion via spring's ConversionService(CollectionToStringConverter)
  which joins by commas. That was we saw in failed example.
- Remove needed joins in CommandParser and let it just pass List which
  then works better with ConversionService.
- This then needs a `command` option type change from String to String[]
  which it really is as you should be able to give whole command as
  an argument.
- Backport #622
- Fixes #623
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch/2.1.x Issue for a branch for/backport For backporting type/bug Is a bug report
Projects
None yet
Development

No branches or pull requests

1 participant