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
argparse help shows arguments in the wrong order #7934
Labels
bug
Issue is reported as a bug
help wanted
Issue not worked on by OTP; help wanted from the community
team:VM
Assigned to OTP team VM
Comments
jhogberg
added
the
help wanted
Issue not worked on by OTP; help wanted from the community
label
Dec 11, 2023
Thanks for your report! We're a bit swamped at the moment so we're not going to be able to fix this in the near future, a PR would be much appreciated. |
While investigating, I came up with another repro:
This shows that each group of arguments is in the correct order, but the groups are reversed. |
Thanks for reporting, taking a look at it. |
rlipscombe
added a commit
to rlipscombe/otp
that referenced
this issue
Dec 11, 2023
rlipscombe
added a commit
to rlipscombe/otp
that referenced
this issue
Dec 11, 2023
And to be explicit about the expected order of the arguments when run:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Issue is reported as a bug
help wanted
Issue not worked on by OTP; help wanted from the community
team:VM
Assigned to OTP team VM
Describe the bug
In experimenting with argparse -- https://www.erlang.org/doc/man/argparse.html, it seems that the help text displays positional arguments for nested commands in the wrong order.
To Reproduce
Here we have an example that takes a "list" command, taking two arguments: "global" (common to all commands) and "what" (specific to the "list" command).
The help text shows the following:
You can see that it claims to expect "what" and then "global".
However, the parser expects "global" and then "what" as seen here:
Expected behavior
The help text should display the positional arguments in the correct order.
Affected versions
OTP-26.1.2
Additional context
I guess you could argue that it's kinda weird to use positional arguments in the face of sub-commands, but argparse allows it, so it should do it correctly.
The text was updated successfully, but these errors were encountered: