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

Return to accepting "-" as a shell option value.

Open wfhoehn opened this issue 1 year ago • 5 comments
trafficstars

Prior to v3.1.0 the spring-shell parser would accept "-" as the value of a shell option. This was a convenient way to indicate that the shell method should stream over inputs from STDIN and worked up through v3.0.10. Many unix commands support a similar syntax.

eg: shell:>foo --bar -

wfhoehn avatar Jan 24 '24 22:01 wfhoehn

Now generates the error:

2001E:(pos 0): Unrecognised option '-' 2000E:(pos 0): Missing mandatory option, longnames='bar', shortnames='b'

wfhoehn avatar Jan 24 '24 22:01 wfhoehn

It would be a good idea to add new functionality to parser so that it could be configured to accept single/double dash as end of options. Then remaining stuff would go into positional arguments(which user can then process manually). Is this something you're after?

jvalkeal avatar Jan 25 '24 15:01 jvalkeal

I'm not certain that I fully understand you. Can you elaborate on "which the user can then process manually?"

wfhoehn avatar Jan 25 '24 23:01 wfhoehn

I assume for double/single dash you meant https://unix.stackexchange.com/questions/11376/what-does-double-dash-mean. Or are you after some stdin piping magic?

jvalkeal avatar Jan 26 '24 09:01 jvalkeal