-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
How to declare multiple args for a shim in a manifest? #2025
Comments
It only supports (1) It copies the third element to |
No in that method, on line 679,
However that array is (inadvertently?) converted to a string when passed to the The reason I wan't sure is because the code that creates the Anyway if only (1) is supported I can continue with that knowledge. |
Oh, the |
No worries, I can add some tests too (once I figure out how that works 😃). So should the array feature be supported? I don't know if any manifests use it (haven't found any that use multiple arg shims; why the bug hasn't really been a problem) |
There is not a single manifest that uses the array declaration, only 2 or 3 that use a string. So maybe we can scrap this feature. |
I apologize, I haven't thought |
@excitoon Hold on, not sure if it was yet decided which way to go on this. However as far as I can tell, there are only two manifests in the main bucket (and none in any of the other known buckets) that use multiple args for a shim, and for each it's just one shim:
It perhaps seems silly to be spending too much time on something that impacts <1% of the manifests, but I think it needs to be one way or the other. (It also means though it's easy to fix the (one) that doesn't comply :) ) If it's the multiple strings way, I would fix the documentation to make it more clear. |
Now it's in. The change to the |
FYI multiple arguments in a single string (used by cygwin) are still broken for .ps1 shims. Also there's now an inconsistency between shim definitions (args declared in separate strings) and shortcut definitions (all args in one string). |
I'll check this out. |
#1986 is irrelevant to this problem. Though I will fix that anyway. |
@stkb @r15ch13
Also, using arguments in single string (1) is technically mutually exclusive with (2) because there is no way to distinguish one argument from many. (Or everyone will have to escape arguments in all cases which is ugly.) Example:
Long story short, we have to make a choice between (1,3) and (2,3). Personally, I like (2,3) because its more consistent and straightforward. |
Please someone reopen this. |
And final thing, |
It's pretty strange that even though we have arrays in PowerShell we have to escape arguments by ourselves. |
(1,2,3) can also be possible, but in that case we require package maintainers to escape spaces manually: |
@excitoon Yeah, I noticed the inconsistencies and bugs in all the creation shims, but I couldn't fix it without knowing what the spec was supposed to be (why I opened this thread). As you say, we really cannot support (1) & (2) at the same time. In my opinion, only (1) should be supported, because:
Hmm, thinking about it a little more, I guess as a compromise there's little reason why we couldn't also support (3) (for both shims and shortcuts) if you really do want to write the arguments out separately. Actually I'm warming to that idea. |
Well, let's keep it as it is - (1,2,3) with manual escaping. I've already fixed |
I was working on a patch for fixing bugs relating to shims, that I've discovered after getting involved with #1951. But I can't really go further until I know the answer to this. The wiki isn't very clear: it just gives the example of
[ "program.exe", "alias", "--arguments" ]
.There are currently 3 ways of adding multiple arguments to a shim that are kinda supported by the code. (Depending on the shim type/target, they may work or not)
[ "shim_target", "shim_name", "arg1 arg2" ]
[ "shim_target", "shim_name", "arg1", "arg2" ]
[ "shim_target", "shim_name", ["arg1", "arg2"] ]
That (3) works is fairly incidental, and it's not supported by the json schema.
The question is are both (1) and (2) supported? And if (1) is supported, is it here two args or a single arg with a space?
The text was updated successfully, but these errors were encountered: