Bare doubledash for conemu commands (#2174)

* Add bare doubledash command line option

The '--' parameter is a common POSIX-style option.  All command-line parameters after the double dash will be joined by a space and forwarded to conemu.

* add bare doubledash command line option

The "--" option indicates that the remaining portion of the command line is forwarded to conemu. Quotes and spacing is retained.

* move all doubledash related code together

* remove unused variable
This commit is contained in:
mdavis199 2019-10-06 16:52:50 -04:00 committed by Martin Kemp
parent 19a2fd11e3
commit e4651cf7b4

View File

@ -633,6 +633,17 @@ cmderOptions GetOption()
cmderOptions.cmderConEmuArgs = szArgList[i + 1]; cmderOptions.cmderConEmuArgs = szArgList[i + 1];
i++; i++;
} }
/* Bare double dash, remaining commandline is for conemu */
else if (_wcsicmp(L"--", szArgList[i]) == 0)
{
std::wstring cmdline = std::wstring(GetCommandLineW());
auto doubledash = cmdline.find(L" -- ");
if (doubledash != std::string::npos)
{
cmderOptions.cmderConEmuArgs = cmdline.substr(doubledash + 4);
}
break;
}
else if (cmderOptions.cmderStart == L"") else if (cmderOptions.cmderStart == L"")
{ {
int len = wcslen(szArgList[i]); int len = wcslen(szArgList[i]);