-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
No good way to pass arguments which contain whitespace or special characters to scripts #5999
Comments
Use single quotes.
…On Thu, Dec 27, 2018, 8:49 AM Fernsehkind ***@***.***> wrote:
*Do you want to request a feature or report a bug?*
Bug and Feature
*What is the current behavior?*
-
Settings/Scripts
-
Example argument: c:\foo.py -c {WorkingDir} -h {hash}, WorkingDir is
set to "c:\temp path with spaces"
-
Is expanded to c:\foo.py -c c:\temp path with spaces\ -hash xyz. The
foo.py script does not recognize the path correctly because it detects it
as multiple arguments
-
Other example argument: c:\foo.py -c "{WorkingDir}" -h "{hash}",
WorkingDir is set to "c:\temp path with spaces"
-
Is expanded to c:\foo.py -c "c:\temp path with spaces" -hash xyz. The
foo.py script does not recognize the path correcly because the backspace at
the end escapes the quote character
*Environment you encounter the issue:*
- GitExtensions version: 3.01.00.0
- GIT version: 2.20.1.windows.1
- OS version: Win 10 Pro (10.0.17763.0)
- .NET version: 4.7.3260.0
*Did this work in previous version of GitExtensions (which)?*
No
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#5999>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/ADdhsRPHwtgJAn4xoxt_dSc-CesP7lxdks5u9NACgaJpZM4Ziy8S>
.
|
Does not work for {WorkingDir} because the ' is also escaped. I pushed a possible solution for this. Please have a look. |
Create a branch for that commit and push it to your repo. Then create a pull request against your branch to our master. In the fixes line of the pull request put 5999 after the #. You can rebase the commit so it doesn't have the fix gitextensions... piece. The pull request will handle the closing of the issue. |
Thanks for testing the ' too. FYI expect a review on that commit when you create the pull request. |
I think this is an ancient bug in MS .NET CLI parser, we've dealt with it before: #3489 (comment)
I believe it should work if you add a space before the closing quote, like so |
This workaround may work in several cases but:
|
Fix #5999: Add option to quote arguments in script parser
Do you want to request a feature or report a bug?
Bug and Feature
What is the current behavior?
Settings/Scripts
Example argument:
c:\foo.py -c {WorkingDir} -h {hash}
, WorkingDir is set toc:\temp path with spaces\
Is expanded to
c:\foo.py -c c:\temp path with spaces\ -hash xyz
. The foo.py script does not recognize the path correctly because it detects it as multiple argumentsOther example argument:
c:\foo.py -c "{WorkingDir}" -h "{hash}"
, WorkingDir is set toc:\temp path with spaces\
Is expanded to
c:\foo.py -c "c:\temp path with spaces\" -hash xyz
. The foo.py script does not recognize the path correctly because the backspace at the end escapes the quote characterEnvironment you encounter the issue:
Did this work in previous version of GitExtensions (which)?
No
The text was updated successfully, but these errors were encountered: