-
Notifications
You must be signed in to change notification settings - Fork 43
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
BUG: Spaces in path cause command line parser to crash #34
Comments
Yeah this is odd but use a space instead of a : with the offending switch. -d On Feb 1, 2012, at 8:52 AM, [email protected] wrote:
|
I did figure that out for the switched arguments (Definitions in Magnum speak), but the exception above is actually from the full path to dk.exe (Arguments in Magnum speak). The workarounds of removing the spaces in my path or setting my working directory closer to dk.exe were more expensive than me just fixing it in Magnum. Note that I also fixed the Definition switch to allow /switch:"some path with spaces". |
that's what I get trying to respond at a stop light. On Wed, Feb 1, 2012 at 10:14 AM, rossbeehler <
|
After fixing this in Magnum, I found out that I was wrong in my assumption. It doesn't pass the path to dk.exe into the parser. What's happening is that the double quotes are getting removed from the value in /switch:"value", and that is done by .NET. However, when I change it to have a space between the switch and value like: /switch "value" .NET still removes the double quotes, and thus those double quotes don't get into Magnum, and we're back to square 1. Is there another workaround I'm missing? |
I made a fix in dk.exe to add double quotes back to the .NET parsed arguments so that Magnum can properly see the double quotes. This was added to pull request #31. |
I was thinking about this some more and realized that the logic to add double quotes back to the command line arguments should probably exist in Magnum and no dk.exe since System.Environment.CommandLine is globaly available . Here would be the pseudo-code in MonadicCommandLineParser:
Let me know if that's the direction we should go, and I'll make the change in that project. |
Hi @rossbeehler, where did you end up with this? I'm running into the same issue, my settings file path has spaces in it and it's blowing up the MonadicCommandLineParser. Was there a resolution or workaround for this? Thanks |
@mmooney I believe this should have been fixed with pull request #31 according to my above comment, but then I also patched it in Magnum: phatboyg/Magnum@7a170f1. |
I have a command line of the following form:
"c:\Some Path With Spaces\dk.exe" execute /environment:DevFit /settings:"c:\Some Path With Spaces\settings" --silent
When I execute, I get the following error:
System.InvalidOperationException: Sequence contains more than one element
at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable
1 source) at dropkick.Engine.DeploymentCommandLineParser.ExtractCommandToRun(IEnumerable
1 commandLineElements)at dropkick.Engine.DeploymentCommandLineParser.Set(DeploymentArguments arguments, IEnumerable`1 commandLineElements)
at dropkick.Engine.DeploymentCommandLineParser.Parse(String commandline)
at dropkick.Engine.Runner.Deploy(String commandLine)
This is a bug with the Magnum.CommandLineParser.MonadicCommandLineParser and underlying classes. I have issued a pull request (#6) in the phatboyg/Magnum project to fix the issue. Once that project is patched, dropkick will need to take in the new Magnum.dll.
The text was updated successfully, but these errors were encountered: