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

Can not recognize short-name shell option with multi chars #1109

Open
sljdxde opened this issue Jul 25, 2024 · 3 comments
Open

Can not recognize short-name shell option with multi chars #1109

sljdxde opened this issue Jul 25, 2024 · 3 comments
Labels
type/bug Is a bug report

Comments

@sljdxde
Copy link

sljdxde commented Jul 25, 2024

version: 3.3.1
jdk: openjdk17
issues:
微信截图_20240724102932

I use -hwp 75 as a command, but recognize as -h 75 and -p 75.

I think this may be an issue, or has other configuration to solve?

@github-actions github-actions bot added the status/need-triage Team needs to triage and take a first look label Jul 25, 2024
@jvalkeal
Copy link
Contributor

Thanks for pointing this out. I think we need to revisit how posix style short options are handled.

https://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html mentions:

Multiple options may follow a hyphen delimiter in a single token if the options do not take arguments. Thus, -abc is equivalent to -a -b -c.

We have that but we're not that strict as combined "short" option can take a value. This is where you get into trouble. I think at mimimum we could check if all from -a -b -c are defined before interpreting -abc as combined. Might also be nice to have a parser option to turn this feature off completely.

@jvalkeal jvalkeal added type/bug Is a bug report and removed status/need-triage Team needs to triage and take a first look labels Jul 28, 2024
@sljdxde
Copy link
Author

sljdxde commented Jul 29, 2024

Thanks for your response.

I refer to spring-shell website and already known the usage of combined "short" option.

I think I can review the code and give some fix suggestions of the issue recently.

I wonder if I can commit a "pr" of this issue when I find a way to solve it?

@jvalkeal
Copy link
Contributor

Sure any help would be appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Is a bug report
Projects
None yet
Development

No branches or pull requests

2 participants