diff --git a/source/dub/commandline.d b/source/dub/commandline.d index c069d89..92092ad 100644 --- a/source/dub/commandline.d +++ b/source/dub/commandline.d @@ -159,7 +159,7 @@ /** Parses the general options and sets up the log level and the root_path */ - void prepareOptions(CommandArgs args) { + string[] prepareOptions(CommandArgs args) { LogLevel loglevel = LogLevel.info; options.prepare(args); @@ -200,6 +200,7 @@ setLoggingColorsEnabled(false); // disable colors, no matter what break; } + return args.extractAllRemainingArgs(); } /** Get an instance of the requested command. @@ -461,7 +462,8 @@ auto common_args = new CommandArgs(args[1..$]); - try handler.prepareOptions(common_args); + try + args = handler.prepareOptions(common_args); catch (Exception e) { logError("Error processing arguments: %s", e.msg); logDiagnostic("Full exception: %s", e.toString().sanitize); @@ -475,8 +477,6 @@ return 0; } - // extract the command - args = common_args.extractAllRemainingArgs(); const command_name = commandNameArgument(args); auto command_args = new CommandArgs(args); Command cmd;