Fix runApplication handling of unrecognized command-line args

`runApplication` takes an `args_out` parameter which, if non-null, is
supposed to be set to match unrecognized command-line args.  However,
the parameter is never passed to `finalizeCommandLineOptions`, which
will therefore log an error and throw an exception if any command line
arguments are unrecognized.

This patch fixes the oversight, ensuring that `runApplication` will
correctly populate a non-null `args_out` parameter with unrecognized
command-line arguments, and not throw an exception in this case.
This commit is contained in:
Joseph Rushton Wakeling 2019-02-22 16:33:01 +01:00
parent bfcf08def0
commit d8e4013c92
No known key found for this signature in database
GPG key ID: AF1FF3E220DC79FC

View file

@ -90,7 +90,7 @@ version (Windows)
*/
int runApplication(string[]* args_out = null)
@safe {
try if (!() @trusted { return finalizeCommandLineOptions(); } () ) return 0;
try if (!() @trusted { return finalizeCommandLineOptions(args_out); } () ) return 0;
catch (Exception e) {
logDiagnostic("Error processing command line: %s", e.msg);
return 1;