mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-10 08:10:49 +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;
|
||||
}
|
||||
else if ([arg isEqual: @"-help"])
|
||||
else if ([arg caseInsensitiveCompare: @"-help"] == NSOrderedSame
|
||||
|| [arg caseInsensitiveCompare: @"--help"] == NSOrderedSame
|
||||
|| [arg caseInsensitiveCompare: @"-h"] == NSOrderedSame)
|
||||
{
|
||||
print_help(stdout);
|
||||
break;
|
||||
|
@ -557,8 +559,8 @@ main(int argc, char **argv, char **env)
|
|||
}
|
||||
else
|
||||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"Invalid option %@", arg];
|
||||
GSPrintf(stderr, @"unrecognized option: %@\n", arg);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue