Allow listing of tools

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@10624 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2001-08-01 10:59:58 +00:00
parent d8ebb20e61
commit 31d2bf6598
4 changed files with 32 additions and 12 deletions

View file

@ -1123,6 +1123,7 @@ static NSString *pathForUser(NSString *user)
if ([key hasPrefix: @"-"])
{
NSString *old = nil;
/* anything beginning with a '-' is a defaults key and we must strip
the '-' from it. As a special case, we leave the '- in place
for '-GS...' and '--GS...' for backward compatibility. */
@ -1132,27 +1133,34 @@ static NSString *pathForUser(NSString *user)
}
key = [key substringFromIndex: 1];
val = [enumerator nextObject];
if (!val)
if (val == nil)
{ // No more args
[argDict setObject: @"" forKey: key]; // arg is empty.
if (old)
[argDict setObject: @"" forKey: old];
if (old != nil)
{
[argDict setObject: @"" forKey: old];
}
done = YES;
continue;
}
else if ([val hasPrefix: @"-"])
else if ([val hasPrefix: @"-"] == YES)
{ // Yet another argument
[argDict setObject: @"" forKey: key]; // arg is empty.
if (old)
[argDict setObject: @"" forKey: old];
if (old != nil)
{
[argDict setObject: @"" forKey: old];
}
key = val;
continue;
}
else
{ // Real parameter
val = [val propertyList];
[argDict setObject: val forKey: key];
if (old)
[argDict setObject: val forKey: old];
if (old != nil)
{
[argDict setObject: val forKey: old];
}
}
}
done = ((key = [enumerator nextObject]) == nil);