add interface for multiple options with the same name

This commit is contained in:
Glenn Maynard
2004-04-30 07:24:29 +00:00
parent fc5c3ad589
commit 81eaecbc63
2 changed files with 8 additions and 2 deletions
+7 -1
View File
@@ -863,7 +863,7 @@ static void ApplyLogPreferences()
* --foo; short arguments (-x) are not supported. (As commandline arguments
* are not intended for common, general use, having short options isn't
* needed.) If argument is non-NULL, accept an argument. */
bool GetCommandlineArgument( const CString &option, CString *argument )
bool GetCommandlineArgument( const CString &option, CString *argument, int iIndex )
{
const CString optstr = "--" + option;
@@ -877,6 +877,12 @@ bool GetCommandlineArgument( const CString &option, CString *argument )
continue; /* no match */
/* Found it. */
if( iIndex )
{
--iIndex;
continue;
}
if( argument )
{
if( i != CString::npos )