From 4714b9b897cdc70671edb3249d68180bbbf3d3f9 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Thu, 13 Dec 2012 23:39:25 +0000 Subject: [PATCH] Fix bad exit running 'swig -go -help' git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13960 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Source/Modules/go.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/Modules/go.cxx b/Source/Modules/go.cxx index a16f710fd..9784ba125 100644 --- a/Source/Modules/go.cxx +++ b/Source/Modules/go.cxx @@ -129,6 +129,7 @@ private: virtual void main(int argc, char *argv[]) { SWIG_library_directory("go"); + bool display_help = false; // Process command line options. for (int i = 1; i < argc; i++) { @@ -190,6 +191,7 @@ private: Swig_arg_error(); } } else if (strcmp(argv[i], "-help") == 0) { + display_help = true; Printf(stdout, "%s\n", usage); } } @@ -215,7 +217,7 @@ private: // This test may be removed in the future, when we can assume that // everybody has upgraded to Go 1.1. The code below is prepared // for this test to simply be taken out. - if (intgo_type_size == 0) { + if (intgo_type_size == 0 && !display_help) { Printf(stderr, "SWIG -go: -intgosize option required but not specified\n"); SWIG_exit(EXIT_FAILURE); }