spring-shell icon indicating copy to clipboard operation
spring-shell copied to clipboard

Start of key value implementation

Open emileplas opened this issue 1 year ago • 0 comments
trafficstars

This is related to https://github.com/spring-projects/spring-shell/issues/979

I spent some time this afternoon with a very simple start:

  • added method to separate key=value pairs and to add key and value to the argument list.
  • added some basic initial tests
  • added configuration option to enable or disable the key value separation

I, however, have some additional questions:

1. For array values: currently, that would look like:

command option one two three

With a key-value separator: would that look like this?

command option==one two three

2. empty values: The current (initial start) implementation would assign this as an empty value:

command option=

I can see where that could be unclear.

3. place of current key-value implementation: Currently, the key-value split method will look at all arguments, including commands. The advantage is that it doesn't touch the Lexer.class tokenize method, but I would understand if only options should be separated from their value using the key value separator. In that case, I will change this a bit.

I didn't want to push this initial draft too far, before getting your feedback. Please let me know what you think.

emileplas avatar Oct 05 '24 18:10 emileplas