ZeroInstall.Publish.Capture.SnapshotDiff.IsolateCommand C# (CSharp) Method

IsolateCommand() private static method

Isolates the path of an executable specified in a command-line relative to a base directory.
private static IsolateCommand ( string commandLine, string baseDir, string &additionalArguments ) : string
commandLine string
baseDir string The directory relative to which the executable is located.
additionalArguments string Returns any additional arguments found.
return string
        private static string IsolateCommand(string commandLine, string baseDir, out string additionalArguments)
        {
            if (!commandLine.StartsWithIgnoreCase("\"" + baseDir + "\\"))
            {
                additionalArguments = null;
                return null;
            }
            commandLine = commandLine.Substring(baseDir.Length + 2);

            additionalArguments = commandLine.GetRightPartAtFirstOccurrence("\" ");
            return commandLine.GetLeftPartAtFirstOccurrence('"');
        }
        #endregion