spring-projects / spring-shell

Spring based shell
http://projects.spring.io/spring-shell/
Apache License 2.0
723 stars 395 forks source link

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

Open wfhoehn opened 7 months ago

wfhoehn commented 7 months ago

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 commented 7 months ago

Now generates the error:

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

jvalkeal commented 7 months ago

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?

wfhoehn commented 7 months ago

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

jvalkeal commented 7 months ago

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?