From 890617f5a507ebc0949dcad68f50934bbe00e14d Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Fri, 8 Feb 2019 17:18:30 +1300 Subject: [PATCH] Fix swig -help to exit with status 0 Fixes #1453 --- Source/Modules/main.cxx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Source/Modules/main.cxx b/Source/Modules/main.cxx index e302241bd..0b615ce0a 100644 --- a/Source/Modules/main.cxx +++ b/Source/Modules/main.cxx @@ -962,11 +962,6 @@ int SWIG_main(int argc, char *argv[], const TargetLanguageModule *tlm) { if (CPlusPlus) Preprocessor_define((DOH *) "__cplusplus __cplusplus", 0); - if (!tlm) { - Printf(stderr, "No target language specified\n"); - return 1; - } - // Parse language dependent options lang->main(argc, argv); @@ -974,6 +969,12 @@ int SWIG_main(int argc, char *argv[], const TargetLanguageModule *tlm) { Printf(stdout, "\nNote: 'swig - -help' displays options for a specific target language.\n\n"); SWIG_exit(EXIT_SUCCESS); // Exit if we're in help mode } + + if (!tlm) { + Printf(stderr, "No target language specified\n"); + return 1; + } + // Check all of the options to make sure we're cool. // Don't check for an input file if -external-runtime is passed Swig_check_options(external_runtime ? 0 : 1);