-
Notifications
You must be signed in to change notification settings - Fork 502
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
Make positional-arguments
default to true next edition
#1367
Comments
My apologies, but from your code
Should this be the expected behavior?
Printing $1 should only prints |
@eRaMvn Good catch! Yup, that's correct, I fixed it. |
so when I played around with powershell, the output is exactly what you printed above
so maybe there is a bug |
Weird! It doesn't do this with sh: set positional-arguments
foo bar:
echo $1
What about if you do:
I'm curious if for some reason |
This is not a pwsh bug per-se, it's a misunderstanding of how positionals work. I wrote about it in detail in #1592, I hope it helps. The usefulness of |
To recap,
set positional-arguments
allows accessing arguments with$N
:This can be very convenient, since it lets you avoid word splitting and possibly extra layers of quoting. I wanted to make this default to true when it was initially implemented, since it's very useful. However, it used to break powershell, and since powershell is widely used, this wouldn't be a suitable default.
However, it appears that powershell now allows this:
So,
positional-arguments
is again a contender to default to true when the next edition is released.The text was updated successfully, but these errors were encountered: