mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-10 16:20:42 +00:00
Allow synonyms for help and print same message as OSX for unrecognised option
This commit is contained in:
parent
d342c4a459
commit
d1bd406e17
1 changed files with 17 additions and 15 deletions
|
@ -538,7 +538,9 @@ main(int argc, char **argv, char **env)
|
||||||
{
|
{
|
||||||
goto parse_file;
|
goto parse_file;
|
||||||
}
|
}
|
||||||
else if ([arg isEqual: @"-help"])
|
else if ([arg caseInsensitiveCompare: @"-help"] == NSOrderedSame
|
||||||
|
|| [arg caseInsensitiveCompare: @"--help"] == NSOrderedSame
|
||||||
|
|| [arg caseInsensitiveCompare: @"-h"] == NSOrderedSame)
|
||||||
{
|
{
|
||||||
print_help(stdout);
|
print_help(stdout);
|
||||||
break;
|
break;
|
||||||
|
@ -557,8 +559,8 @@ main(int argc, char **argv, char **env)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
[NSException raise: NSInvalidArgumentException
|
GSPrintf(stderr, @"unrecognized option: %@\n", arg);
|
||||||
format: @"Invalid option %@", arg];
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue