ENH: take cmake style command line options so edit_cache works

This commit is contained in:
Bill Hoffman 2002-05-08 09:43:45 -04:00
parent 0caf44cb5d
commit 6e472fdbb0
1 changed files with 30 additions and 25 deletions

View File

@ -54,33 +54,38 @@ void CMakeCommandLineInfo::ParseParam(LPCTSTR lpszParam, BOOL bFlag, BOOL bLast)
{ {
CString sParam(lpszParam); CString sParam(lpszParam);
// Single letter valued flag like /B=value or /B:value // Single letter valued flag like /B=value or /B:value
CString value;
if (sParam[1] == '=' || sParam[1] == ':') if (sParam[1] == '=' || sParam[1] == ':')
{ {
CString value(sParam.Right(sParam.GetLength() - 2)); value = sParam.Right(sParam.GetLength() - 2);
int res; }
switch (sParam[0]) else
{ {
case 'A': value = sParam.Right(sParam.GetLength()-1);
res = CMakeCommandLineInfo::GetBoolValue(value); }
if (res == 1) int res;
{ switch (sParam[0])
m_AdvancedValues = TRUE; {
} case 'A':
else if (res == -1) res = CMakeCommandLineInfo::GetBoolValue(value);
{ if (res == 1)
m_AdvancedValues = FALSE; {
} m_AdvancedValues = TRUE;
break; }
case 'B': else if (res == -1)
m_WhereBuild = value; {
break; m_AdvancedValues = FALSE;
case 'G': }
m_GeneratorChoiceString = value; break;
break; case 'B':
case 'H': m_WhereBuild = value;
m_WhereSource = value; break;
break; case 'G':
} m_GeneratorChoiceString = value;
break;
case 'H':
m_WhereSource = value;
break;
} }
} }