diff --git a/source/app.d b/source/app.d index b2f705b..65c3b5a 100644 --- a/source/app.d +++ b/source/app.d @@ -43,6 +43,14 @@ } try { + // split application arguments from DUB arguments + string[] app_args; + auto app_args_idx = args.countUntil("--"); + if (app_args_idx >= 0) { + app_args = args[app_args_idx+1 .. $]; + args = args[0 .. app_args_idx]; + } + // parse general options bool verbose, vverbose, quiet, vquiet; bool help, nodeps, annotate; @@ -56,7 +64,6 @@ string install_version; string[] registry_urls; string[] debug_versions; - string[] app_args; string root_path = getcwd(); getopt(args, "v|verbose", &verbose, @@ -94,13 +101,6 @@ args = args[0] ~ args[2 .. $]; } else cmd = "run"; - // contrary to the documentation, getopt does not remove -- - auto app_args_idx = args.countUntil("--"); - if (app_args_idx >= 0) { - app_args = args[app_args_idx+1 .. $]; - args = args[0 .. app_args_idx]; - } - // display help if requested (obsolete) if( help ){ showHelp(cmd);