diff --git a/source/dub/commandline.d b/source/dub/commandline.d index f4c5fd6..d75b235 100644 --- a/source/dub/commandline.d +++ b/source/dub/commandline.d @@ -122,10 +122,9 @@ // extract the command string cmdname; args = common_args.extractRemainingArgs(); - auto cmdidx = args.countUntil!(a => !a.startsWith("-")); - if (cmdidx >= 0) { - cmdname = args[cmdidx]; - args = args[0 .. cmdidx] ~ args[cmdidx+1 .. $]; + if (args.length >= 1 && !args[0].startsWith("-")) { + cmdname = args[0]; + args = args[1 .. $]; } else { if (help) { showHelp(commands, common_args);