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:
parent
bfcf08def0
commit
d8e4013c92
|
@ -90,7 +90,7 @@ version (Windows)
|
||||||
*/
|
*/
|
||||||
int runApplication(string[]* args_out = null)
|
int runApplication(string[]* args_out = null)
|
||||||
@safe {
|
@safe {
|
||||||
try if (!() @trusted { return finalizeCommandLineOptions(); } () ) return 0;
|
try if (!() @trusted { return finalizeCommandLineOptions(args_out); } () ) return 0;
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
logDiagnostic("Error processing command line: %s", e.msg);
|
logDiagnostic("Error processing command line: %s", e.msg);
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Reference in a new issue