Fix swig --help -<lang> working differently to swig -help -<lang>

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9024 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2006-03-20 22:05:28 +00:00
commit b3bf82ca45
2 changed files with 27 additions and 25 deletions

View file

@ -720,7 +720,7 @@ void SWIG_getoptions(int argc, char *argv[])
Wrapper_virtual_elimination_mode_set(1); Wrapper_virtual_elimination_mode_set(1);
Wrapper_fast_dispatch_mode_set(1); Wrapper_fast_dispatch_mode_set(1);
Swig_mark_arg(i); Swig_mark_arg(i);
} else if ((strcmp(argv[i],"-help") == 0) || (strcmp(argv[i],"--help") == 0)) { } else if (strcmp(argv[i],"-help") == 0) {
fputs(usage1,stdout); fputs(usage1,stdout);
fputs(usage2,stdout); fputs(usage2,stdout);
fputs(usage3,stdout); fputs(usage3,stdout);

View file

@ -175,7 +175,9 @@ int main(int margc, char **margv) {
{ {
Printf(stderr,"swig: Warning. %s option deprecated.\n",argv[i]); Printf(stderr,"swig: Warning. %s option deprecated.\n",argv[i]);
Swig_mark_arg(i); Swig_mark_arg(i);
} else if (strcmp(argv[i],"-help") == 0) { } else if ((strcmp(argv[i],"-help") == 0) || (strcmp(argv[i],"--help") == 0)) {
if (strcmp(argv[i],"--help") == 0)
strcpy(argv[i], "-help");
Printf(stdout,"Target Language Options\n"); Printf(stdout,"Target Language Options\n");
for (int j = 0; modules[j].name; j++) { for (int j = 0; modules[j].name; j++) {
if (modules[j].help) { if (modules[j].help) {