Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Do not quote arguments with backslash separator #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kzu
Copy link
Contributor

@kzu kzu commented Jul 16, 2019

This particular behavior breaks invoking 7zip with provisionator, because the output path
parameter is specified as -o[PATH]. If the PATH has no spaces, no quoting is necessary
around -o and it just works. However, with the current behavior, specifying "-o[PATH]"
fails with 7zip not able to find the path.

Since we're not quoting / either, I wonder what's the rationale for quoting when \ is
present? Granted, that format for 7zip CLI is weird (all parameter values to right after the
switch, with no space), and if quoting is needed, the quote is supposed to go around the
switch value, but exclude the switch itself, but at least one could work around that by
ensuring there are no whitespaces in the -o parameter, if it weren't for this existing quoting
behavior.

This particular behavior breaks invoking 7zip with provisionator, because the output path 
parameter is specified as `-o[PATH]`. If the `PATH` has no spaces, no quoting is necessary 
around `-o` and it just works. However, with the current behavior, specifying `"-o[PATH]"` 
fails with 7zip not able to find the path.

Since we're not quoting `/` either, I wonder what's the rationale for quoting when `\` is 
present? Granted, that format for 7zip CLI is weird (all parameter values to right after the 
switch, with no space), and if quoting is needed, the quote is supposed to go around the 
switch value, but exclude the switch itself, but at least one could work around that by 
ensuring there are no whitespaces in the `-o` parameter, if it weren't for this existing quoting
behavior.
@kzu kzu requested a review from abock July 16, 2019 15:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant